Page MenuHomePhabricator

PHP Notice: Undefined offset: 5
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Notice: Undefined offset: 5
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.20/includes/logging/DeleteLogFormatter.php(84)
#0 /srv/mediawiki/php-1.37.0-wmf.20/includes/logging/DeleteLogFormatter.php(84): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.37.0-wmf.20/includes/logging/DeleteLogFormatter.php(43): DeleteLogFormatter->getMessageParameters()
#2 /srv/mediawiki/php-1.37.0-wmf.20/includes/logging/LogFormatter.php(489): DeleteLogFormatter->getMessageKey()
#3 /srv/mediawiki/php-1.37.0-wmf.20/includes/logging/LogFormatter.php(465): LogFormatter->getActionMessage()
#4 /srv/mediawiki/php-1.37.0-wmf.20/includes/logging/LogEventsList.php(392): LogFormatter->getActionText()
#5 /srv/mediawiki/php-1.37.0-wmf.20/includes/logging/LogPager.php(434): LogEventsList->logLine(stdClass)
#6 /srv/mediawiki/php-1.37.0-wmf.20/includes/pager/IndexPager.php(607): LogPager->formatRow(stdClass)
#7 /srv/mediawiki/php-1.37.0-wmf.20/includes/specials/SpecialLog.php(274): IndexPager->getBody()
#8 /srv/mediawiki/php-1.37.0-wmf.20/includes/specials/SpecialLog.php(156): SpecialLog->show(FormOptions, array)
#9 /srv/mediawiki/php-1.37.0-wmf.20/includes/specialpage/SpecialPage.php(646): SpecialLog->execute(NULL)
#10 /srv/mediawiki/php-1.37.0-wmf.20/includes/specialpage/SpecialPageFactory.php(1366): SpecialPage->run(NULL)
#11 /srv/mediawiki/php-1.37.0-wmf.20/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#12 /srv/mediawiki/php-1.37.0-wmf.20/includes/MediaWiki.php(925): MediaWiki->performRequest()
#13 /srv/mediawiki/php-1.37.0-wmf.20/includes/MediaWiki.php(559): MediaWiki->main()
#14 /srv/mediawiki/php-1.37.0-wmf.20/index.php(53): MediaWiki->run()
#15 /srv/mediawiki/php-1.37.0-wmf.20/index.php(46): wfIndexMain()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}

Seems to be new in .20.

Details

Request URL
https://commons.wikimedia.org/w/index.php?title=*&dir=*&type=*&user=*&page=*&wpdate=*&tagfilter=*&subtype=*

Event Timeline

This is consistently reproducible when viewing some very old log entries. For example: https://commons.wikimedia.org/wiki/Special:Log?type=delete&user=&page=&wpdate=2009-04-26&tagfilter=&subtype=revision&limit=2

Compared to recent log entries, the log display is missing information about which part of the revision was deleted (e.g. "content hidden").

It would take some archeology to find out why today's MediaWiki doesn't like them.

This is the api query to find both log entries. Possible trigger a warning as well:
https://commons.wikimedia.org/w/api.php?action=query&list=logevents&leaction=delete/revision&lelimit=2&lestart=2009-04-26T15:49:00Z&leprop=ids|title|type|user|userid|timestamp|comment|parsedcomment|details|tags

The test DeleteLogFormatterTest contains many old formats to test against, but possible thats a old format not part of it.

Maybe a special case of T224815?

[Old log entries and unchanged DeleteLogFormatter class sounds not like a blocker for the train]

The bit masks are added as part of ec0dd5b272c193d4641d9a265fe4937628a61ffd to the logs, which is around the log entries are created here. Logs older than the deployment of that revision are affected.

Change 743599 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] Allow DeleteLogFormatter to work with pre-T20361 (April 2009) log rows

https://gerrit.wikimedia.org/r/743599

Change 743599 merged by jenkins-bot:

[mediawiki/core@master] Allow DeleteLogFormatter to work with pre-T20361 (April 2009) log rows

https://gerrit.wikimedia.org/r/743599