Page MenuHomePhabricator

ImageHistoryPseudoPager: PHP Notice: Undefined offset: [n]
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Notice: Undefined offset: 1
exception.trace
from /srv/mediawiki/php-1.38.0-wmf.3/includes/page/ImageHistoryPseudoPager.php(142)
#0 /srv/mediawiki/php-1.38.0-wmf.3/includes/page/ImageHistoryPseudoPager.php(142): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.38.0-wmf.3/includes/page/ImagePage.php(838): ImageHistoryPseudoPager->getBody()
#2 /srv/mediawiki/php-1.38.0-wmf.3/includes/page/ImagePage.php(183): ImagePage->imageHistory()
#3 /srv/mediawiki/php-1.38.0-wmf.3/includes/actions/ViewAction.php(74): ImagePage->view()
#4 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(538): ViewAction->show()
#5 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(320): MediaWiki->performAction(ImagePage, Title)
#6 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(925): MediaWiki->performRequest()
#7 /srv/mediawiki/php-1.38.0-wmf.3/includes/MediaWiki.php(559): MediaWiki->main()
#8 /srv/mediawiki/php-1.38.0-wmf.3/index.php(53): MediaWiki->run()
#9 /srv/mediawiki/php-1.38.0-wmf.3/index.php(46): wfIndexMain()
#10 /srv/mediawiki/w/index.php(3): require(string)
#11 {main}
Impact

A string of errors (~50 in a 10 minute window) occurred after deployment to group0, causing a rollback

Notes

Event Timeline

brennen renamed this task from PHP Notice: Undefined offset: 1 to ImageHistoryPseudoPager: PHP Notice: Undefined offset: [n].Tue, Oct 5, 7:30 PM
brennen moved this task from Backlog to Logs/Train on the User-brennen board.

Ok, this is clearly a fallout from CommentFormatter.

The loop that formats the comments is skipped for non-local files, while the loop that's showing the comments is not skipped. Boom.

Change 726680 had a related patch set uploaded (by Ppchelko; author: Ppchelko):

[mediawiki/core@master] Pre-format comments for non-local files too

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

^ should take care of this. Didn't test locally cause it's really, really hard to test locally.

should take care of this. Didn't test locally cause it's really, really hard to test locally.

We can probably test this cleanly on an mwdebug, right?

yup. a page view request to any non-local file will be a sufficient test. the URL from task description for example

Change 726594 had a related patch set uploaded (by Brennen Bearnes; author: Ppchelko):

[mediawiki/core@wmf/1.38.0-wmf.3] Pre-format comments for non-local files too

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

Change 726594 merged by jenkins-bot:

[mediawiki/core@wmf/1.38.0-wmf.3] Pre-format comments for non-local files too

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

Mentioned in SAL (#wikimedia-operations) [2021-10-05T20:44:48Z] <brennen@deploy1002> Synchronized php-1.38.0-wmf.3/includes/page: Backport: [[gerrit:726594|Pre-format comments for non-local files too]] (T292570) (duration: 01m 04s)

brennen lowered the priority of this task from Unbreak Now! to Needs Triage.Tue, Oct 5, 8:58 PM

Looks fixed in production, removing as a train blocker, leaving open in case there's feedback on the patch for master.

Since the patch has not been merged into master this is going to regress and the error is going to show up again in wmf.4.

Change 730226 had a related patch set uploaded (by Zabe; author: Ppchelko):

[mediawiki/core@wmf/1.38.0-wmf.4] Pre-format comments for non-local files too

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

Change 726680 merged by jenkins-bot:

[mediawiki/core@master] Pre-format comments for non-local files too

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

Change 730226 merged by jenkins-bot:

[mediawiki/core@wmf/1.38.0-wmf.4] Pre-format comments for non-local files too

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

Mentioned in SAL (#wikimedia-operations) [2021-10-12T16:26:28Z] <dancy@deploy1002> Synchronized php-1.38.0-wmf.4/includes: Backport: [[gerrit:730226|Pre-format comments for non-local files too (T292570)]] (duration: 01m 15s)

dancy claimed this task.