Page MenuHomePhabricator

PHP Notice: Undefined offset: 6 in extensions/JsonConfig/includes/JCTabularContentView.php
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.35.0-wmf.16

message
PHP Notice: Undefined offset: 6

Impact

Notes

Details

Request ID
XkGe0ApAMEMAAG6ZvfwAAABV
Request URL
https://commons.wikimedia.org/w/api.php
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.16/extensions/JsonConfig/includes/JCTabularContentView.php(114): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.35.0-wmf.16/extensions/JsonConfig/includes/JCContent.php(195): JsonConfig\JCTabularContentView->valueToHtml(JsonConfig\JCTabularContent, Title, NULL, ParserOptions, boolean, ParserOutput)
#2 /srv/mediawiki/php-1.35.0-wmf.16/includes/content/AbstractContent.php(555): JsonConfig\JCContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#3 /srv/mediawiki/php-1.35.0-wmf.16/includes/Revision/RenderedRevision.php(267): AbstractContent->getParserOutput(Title, NULL, ParserOptions, boolean)
#4 /srv/mediawiki/php-1.35.0-wmf.16/includes/Revision/RenderedRevision.php(236): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(JsonConfig\JCTabularContent, boolean)
#5 /srv/mediawiki/php-1.35.0-wmf.16/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#6 /srv/mediawiki/php-1.35.0-wmf.16/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#7 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#8 /srv/mediawiki/php-1.35.0-wmf.16/includes/Revision/RenderedRevision.php(198): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#9 /srv/mediawiki/php-1.35.0-wmf.16/includes/Storage/DerivedPageDataUpdater.php(1290): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#10 [internal function]: MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()
#11 /srv/mediawiki/php-1.35.0-wmf.16/includes/edit/PreparedEdit.php(104): call_user_func(array)
#12 /srv/mediawiki/php-1.35.0-wmf.16/includes/edit/PreparedEdit.php(119): MediaWiki\Edit\PreparedEdit->getOutput()
#13 /srv/mediawiki/php-1.35.0-wmf.16/includes/Storage/DerivedPageDataUpdater.php(1268): MediaWiki\Edit\PreparedEdit->__get(string)
#14 /srv/mediawiki/php-1.35.0-wmf.16/includes/page/WikiPage.php(2029): MediaWiki\Storage\DerivedPageDataUpdater->getPreparedEdit()
#15 /srv/mediawiki/php-1.35.0-wmf.16/extensions/SpamBlacklist/includes/SpamBlacklistHooks.php(30): WikiPage->prepareContentForEdit(JsonConfig\JCTabularContent)
#16 /srv/mediawiki/php-1.35.0-wmf.16/includes/Hooks.php(174): SpamBlacklistHooks::filterMergedContent(DerivativeContext, JsonConfig\JCTabularContent, Status, string, User, boolean)
#17 /srv/mediawiki/php-1.35.0-wmf.16/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#18 /srv/mediawiki/php-1.35.0-wmf.16/includes/EditPage.php(1801): Hooks::run(string, array)
#19 /srv/mediawiki/php-1.35.0-wmf.16/includes/EditPage.php(2133): EditPage->runPostMergeFilters(JsonConfig\JCTabularContent, Status, User)
#20 /srv/mediawiki/php-1.35.0-wmf.16/includes/EditPage.php(1623): EditPage->internalAttemptSave(NULL, boolean)
#21 /srv/mediawiki/php-1.35.0-wmf.16/includes/api/ApiEditPage.php(398): EditPage->attemptSave(NULL)
#22 /srv/mediawiki/php-1.35.0-wmf.16/includes/api/ApiMain.php(1603): ApiEditPage->execute()
#23 /srv/mediawiki/php-1.35.0-wmf.16/includes/api/ApiMain.php(539): ApiMain->executeAction()
#24 /srv/mediawiki/php-1.35.0-wmf.16/includes/api/ApiMain.php(510): ApiMain->executeActionWithErrorHandling()
#25 /srv/mediawiki/php-1.35.0-wmf.16/api.php(78): ApiMain->execute()
#26 /srv/mediawiki/w/api.php(3): require(string)
#27 {main}

Event Timeline

Krinkle subscribed.

I'm not sure what JsonConfig is used for with WPZero gone, but it's still deployed. Per mw:Maintainers this is now listed as stewarded by Reading. Tagging Reading-Infra to start. Feel free to forward as needed.

I'm not sure what JsonConfig is used for with WPZero gone, but it's still deployed.

Content. See https://commons.wikimedia.org/wiki/Special:Random/Data

Jhernandez subscribed.

Given there is no impact I'm making this Low and backlog.

Feel free to ping us or rise priority if it is important to fix. Thanks.

@Jhernandez If you've determined that there is no chance for data leak or data corruption as result of this silent error, and determined there is no user-visible impact or that it doesn't matter right now from a product perspective, then I would recommend patching the code to simply tolerate this error as-is.

Right now it produces noise during deployments and operational monitoring that is indistinguisable from actual regressions that are actively causing problems. This slows down everyone while debugging and deploying, and can, when triggered by users, even cause alarms that abort deployments or wake up SRE. That isn't great :)

Jhernandez raised the priority of this task from Low to Medium.Feb 20 2020, 4:09 PM

@Jhernandez If you've determined that there is no chance for data leak or data corruption as result of this silent error, and determined there is no user-visible impact or that it doesn't matter right now from a product perspective, then I would recommend patching the code to simply tolerate this error as-is.

I'm sorry if my wording (Given there is no impact) was confusing, I said that by looking at the task description.

This needs to be looked at more then, we haven't right now. Our team member that mainly maintains Maps and JsonConfig is out unavailable and may come back next week or in a month, we don't know. Meanwhile, we are very much understaffed specially on Maps & JsonConfig areas.

Any help is appreciated, specially given that Maps is a lot more broken at this point in time and fixing it has higher priority.

Right now it produces noise during deployments and operational monitoring that is indistinguisable from actual regressions that are actively causing problems. This slows down everyone while debugging and deploying, and can, when triggered by users, even cause alarms that abort deployments or wake up SRE. That isn't great :)

Yeah that is bad. We are maintainers of this by chance, not because we wrote it or are extremely familiar with it, and the last thing we want to do is confuse or slow down other teammates in other teams.

My team right now is effectively ~2 engineers, and we have our hands full. I will raise this with them to see if they can look at it in some spare time but would appreciate if anyone else chimes in earlier.

This is being triggered when a malformed data object somehow slips past validation. I am not sure precisely how to reproduce it — validation worked as expected on my attempts to reproduce what I thought was going on — so I left a message requesting more info on the talk page of the user who most recently triggered this.

(Brain dump from my investigation a day or two ago)

This is actually relatively rare. It hasn't happened yet on wmf.20. On wmf.19, there were 2,507 occurrences, but all resulting from the same single event: during an attempt to upload a data set, schema info for columns beyond the first column was somehow not present, so the notice fired once for each cell beyond the first in each row, so 109 rows * (24 - 1 columns) = 2,507 notices. The data set in question was Data:Requests_for_WMF_user_data.tab (as indicated by the exception_url of /w/index.php?title=Data:Requests_for_WMF_user_data.tab&action=submit).

Those notices fired at 06:37 on February 18. It appears that the data set was uploaded successfully at 06:42, and I don't see any sign of data corruption. Perhaps there was a first upload attempt that failed, and the user retried after making an adjustment to the schema info, and succeeded. (I've asked for information on the uploader's talk page, but received no response so far.)

I'd still like to know how this is happening despite JsonConfig's data validation. As I mentioned earlier, I haven't been able to reproduce it on Beta. That said, the impact (other than on the MW logs) appears to be low to nonexistent.

Change 612571 had a related patch set uploaded (by MSantos; owner: MSantos):
[mediawiki/extensions/JsonConfig@master] gracefully handle error for malformeddata object..

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

Just noting we are still seeing this in production:

exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.41/extensions/JsonConfig/includes/JCTabularContentView.php(114): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.35.0-wmf.41/extensions/JsonConfig/includes/JCContent.php(195): JsonConfig\JCTabularContentView->valueToHtml(JsonConfig\JCTabularContent, Title, NULL, ParserOptions, boolean, ParserOutput)
#2 /srv/mediawiki/php-1.35.0-wmf.41/includes/content/AbstractContent.php(590): JsonConfig\JCContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#3 /srv/mediawiki/php-1.35.0-wmf.41/includes/EditPage.php(4268): AbstractContent->getParserOutput(Title, NULL, ParserOptions)
#4 /srv/mediawiki/php-1.35.0-wmf.41/includes/EditPage.php(4173): EditPage->doPreviewParse(JsonConfig\JCTabularContent)
#5 /srv/mediawiki/php-1.35.0-wmf.41/includes/EditPage.php(2954): EditPage->getPreviewText()
#6 /srv/mediawiki/php-1.35.0-wmf.41/includes/EditPage.php(700): EditPage->showEditForm()
#7 /srv/mediawiki/php-1.35.0-wmf.41/includes/actions/EditAction.php(71): EditPage->edit()
#8 /srv/mediawiki/php-1.35.0-wmf.41/includes/actions/SubmitAction.php(38): EditAction->show()
#9 /srv/mediawiki/php-1.35.0-wmf.41/includes/MediaWiki.php(527): SubmitAction->show()
#10 /srv/mediawiki/php-1.35.0-wmf.41/includes/MediaWiki.php(313): MediaWiki->performAction(Article, Title)
#11 /srv/mediawiki/php-1.35.0-wmf.41/includes/MediaWiki.php(940): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.35.0-wmf.41/includes/MediaWiki.php(543): MediaWiki->main()
#13 /srv/mediawiki/php-1.35.0-wmf.41/index.php(53): MediaWiki->run()
#14 /srv/mediawiki/php-1.35.0-wmf.41/index.php(46): wfIndexMain()
#15 /srv/mediawiki/w/index.php(3): require(string)
#16 {main}

Change 612571 merged by jenkins-bot:
[mediawiki/extensions/JsonConfig@master] gracefully handle error for malformed data object

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