Page MenuHomePhabricator

"PHP Warning: A non-numeric value encountered" from NamespaceInfo.php via SpecialRecentChanges.php - NamespaceInfo::isTalk called with non-integer (string) namespace '-1'
Closed, ResolvedPublicPRODUCTION ERROR

Description

  • Wiki: ltwiki
  • User impact: unknown
  • Frequency: 15000+
  • Origin: Logstash
[XsM77wpAAEUAAJ0oZ-sAAACB] /w/index.php?invert=1&associated=1&tagfilter=1&title=Specialus%3ANaujausi%20keitimai&namespace=arachni_name   ErrorException from line 175 of /srv/mediawiki/php-1.35.0-wmf.31/includes/title/NamespaceInfo.php: PHP Warning: A non-numeric value encountered
#0 /srv/mediawiki/php-1.35.0-wmf.31/includes/title/NamespaceInfo.php(175): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.35.0-wmf.31/includes/title/NamespaceInfo.php(269): NamespaceInfo->getTalk(string)
#2 /srv/mediawiki/php-1.35.0-wmf.31/includes/specialpage/ChangesListSpecialPage.php(1538): NamespaceInfo->getAssociated(string)
#3 [internal function]: ChangesListSpecialPage->{closure}(string)
#4 /srv/mediawiki/php-1.35.0-wmf.31/includes/specialpage/ChangesListSpecialPage.php(1544): array_map(Closure, array)
#5 /srv/mediawiki/php-1.35.0-wmf.31/includes/specialpage/ChangesListSpecialPage.php(1022): ChangesListSpecialPage->buildQuery(array, array, array, array, array, FormOptions)
#6 /srv/mediawiki/php-1.35.0-wmf.31/includes/specialpage/ChangesListSpecialPage.php(629): ChangesListSpecialPage->getRows()
#7 /srv/mediawiki/php-1.35.0-wmf.31/includes/specials/SpecialRecentChanges.php(164): ChangesListSpecialPage->execute(NULL)
#8 /srv/mediawiki/php-1.35.0-wmf.31/includes/specialpage/SpecialPage.php(576): SpecialRecentChanges->execute(NULL)
#9 /srv/mediawiki/php-1.35.0-wmf.31/includes/specialpage/SpecialPageFactory.php(618): SpecialPage->run(NULL)
#10 /srv/mediawiki/php-1.35.0-wmf.31/includes/MediaWiki.php(299): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /srv/mediawiki/php-1.35.0-wmf.31/includes/MediaWiki.php(973): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.35.0-wmf.31/includes/MediaWiki.php(535): MediaWiki->main()
#13 /srv/mediawiki/php-1.35.0-wmf.31/index.php(47): MediaWiki->run()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}

Details

Request ID
571489e6-9647-4fb9-a3c1-a5d53d6ea40b
Stack Trace
#0 /srv/mediawiki/php-1.35.0-wmf.36/includes/title/NamespaceInfo.php(189): NamespaceInfo->makeValidNamespace(string, string)
#1 /srv/mediawiki/php-1.35.0-wmf.36/includes/changes/ChangesList.php(246): NamespaceInfo->isTalk(string)
#2 /srv/mediawiki/php-1.35.0-wmf.36/includes/changes/ChangesList.php(224): ChangesList->getHTMLClassesForFilters(RecentChange)
#3 /srv/mediawiki/php-1.35.0-wmf.36/includes/changes/OldChangesList.php(37): ChangesList->getHTMLClasses(RecentChange, boolean)
#4 /srv/mediawiki/php-1.35.0-wmf.36/includes/specials/SpecialRecentChanges.php(440): OldChangesList->recentChangesLine(RecentChange, boolean, integer)
#5 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/ChangesListSpecialPage.php(1659): SpecialRecentChanges->outputChangesList(Wikimedia\Rdbms\ResultWrapper, FormOptions)
#6 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/ChangesListSpecialPage.php(671): ChangesListSpecialPage->webOutput(Wikimedia\Rdbms\ResultWrapper, FormOptions)
#7 /srv/mediawiki/php-1.35.0-wmf.36/includes/specials/SpecialRecentChanges.php(164): ChangesListSpecialPage->execute(NULL)
#8 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/SpecialPage.php(580): SpecialRecentChanges->execute(NULL)
#9 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/SpecialPageFactory.php(634): SpecialPage->run(NULL)
#10 /srv/mediawiki/php-1.35.0-wmf.36/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /srv/mediawiki/php-1.35.0-wmf.36/includes/MediaWiki.php(986): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.35.0-wmf.36/includes/MediaWiki.php(543): MediaWiki->main()
#13 /srv/mediawiki/php-1.35.0-wmf.36/index.php(47): MediaWiki->run()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}

Event Timeline

OK. Seems duplicate of: T252077.

The PHP warning for "A non-numeric value encountered" just means that some code somewhere used a number value incorrectly. Similar to general errors like "Variable undefined" or "Class undefined" these are not usually the same issue.

Do we think that the root cause for these two happens to be the same?

Change 598117 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] NamespaceInfo: Throw specifically if called on a non-int namespace

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

Krinkle renamed this task from Logspam: ErrorException from line 175 of /srv/mediawiki/php-1.35.0-wmf.31/includes/title/NamespaceInfo.php: PHP Warning: A non-numeric value encountered to "PHP Warning: A non-numeric value encountered" from NamespaceInfo.php via SpecialRecentChanges.php.May 27 2020, 7:12 PM

Change 598117 merged by jenkins-bot:
[mediawiki/core@master] NamespaceInfo: Throw specifically if called on a non-int/non-int-like namespace

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

OK, now with the better error we can see the trigger:

exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.36/includes/title/NamespaceInfo.php(189): NamespaceInfo->makeValidNamespace(string, string)
#1 /srv/mediawiki/php-1.35.0-wmf.36/includes/changes/ChangesList.php(246): NamespaceInfo->isTalk(string)
#2 /srv/mediawiki/php-1.35.0-wmf.36/includes/changes/ChangesList.php(224): ChangesList->getHTMLClassesForFilters(RecentChange)
#3 /srv/mediawiki/php-1.35.0-wmf.36/includes/changes/OldChangesList.php(37): ChangesList->getHTMLClasses(RecentChange, boolean)
#4 /srv/mediawiki/php-1.35.0-wmf.36/includes/specials/SpecialRecentChanges.php(440): OldChangesList->recentChangesLine(RecentChange, boolean, integer)
#5 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/ChangesListSpecialPage.php(1659): SpecialRecentChanges->outputChangesList(Wikimedia\Rdbms\ResultWrapper, FormOptions)
#6 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/ChangesListSpecialPage.php(671): ChangesListSpecialPage->webOutput(Wikimedia\Rdbms\ResultWrapper, FormOptions)
#7 /srv/mediawiki/php-1.35.0-wmf.36/includes/specials/SpecialRecentChanges.php(164): ChangesListSpecialPage->execute(NULL)
#8 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/SpecialPage.php(580): SpecialRecentChanges->execute(NULL)
#9 /srv/mediawiki/php-1.35.0-wmf.36/includes/specialpage/SpecialPageFactory.php(634): SpecialPage->run(NULL)
#10 /srv/mediawiki/php-1.35.0-wmf.36/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /srv/mediawiki/php-1.35.0-wmf.36/includes/MediaWiki.php(986): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.35.0-wmf.36/includes/MediaWiki.php(543): MediaWiki->main()
#13 /srv/mediawiki/php-1.35.0-wmf.36/index.php(47): MediaWiki->run()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}

Change 604386 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] NamespaceInfo::makeValidNamespace: Don't throw for -1 or -2

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

Is this not a train blocker? RC isn't showing on metawiki and enwikiquote.

Indeed, T255016#6211050 implies to me that this should block the train. Someone feel free to correct me.

taavi triaged this task as High priority.Jun 10 2020, 4:08 PM

@Aklapper Reverting largely per T254173#6210902 and -operations when this was initially found

Aklapper renamed this task from "PHP Warning: A non-numeric value encountered" from NamespaceInfo.php via SpecialRecentChanges.php to "PHP Warning: A non-numeric value encountered" from NamespaceInfo.php via SpecialRecentChanges.php - NamespaceInfo::isTalk called with non-integer (string) namespace '-1'.Jun 11 2020, 5:32 AM
Aklapper changed the subtype of this task from "Task" to "Production Error".
Aklapper set Request ID to 571489e6-9647-4fb9-a3c1-a5d53d6ea40b.
Aklapper edited Stack Trace. (Show Details)
Aklapper set Phatality ID to 48403fa39ebf2183465d8f3c4e840632ce3034759c6fd21c6eae0cff58586961.
Aklapper added subscribers: DannyS712, CptViraj, Shizhao.

Is this the cause for Recent Changes on nl.wiktionary showing just the message "Internal Error" (Interne fout)? This is blocking the patroling against spam and vandals, so it is an urgent problem.

Is this the cause for Recent Changes on nl.wiktionary showing just the message "Internal Error" (Interne fout)? This is blocking the patroling against spam and vandals, so it is an urgent problem.

Yes, this is the cause

Is this the cause for Recent Changes on nl.wiktionary showing just the message "Internal Error" (Interne fout)?

Hmm, yes, somehow the default view is invalid there due to a bad log entry; please use https://nl.wiktionary.org/w/index.php?hidebots=1&hidecategorization=1&hideWikibase=1&hidelog=1&limit=50&days=7&title=Speciaal:RecenteWijzigingen&urlversion=2 for now.

Is this not a train blocker? RC isn't showing on metawiki and enwikiquote.

And even when logged out at https://meta.wikimedia.org/wiki/Special:RecentChanges , so this is definitely "Unbreak now" material.

taavi raised the priority of this task from High to Unbreak Now!.Jun 11 2020, 7:53 AM

Is this not a train blocker? RC isn't showing on metawiki and enwikiquote.

And even when logged out at https://meta.wikimedia.org/wiki/Special:RecentChanges , so this is definitely "Unbreak now" material.

Raising to UBN. (for context, yesterday it only affected users with saved watchlist settings)

Is this not a train blocker? RC isn't showing on metawiki and enwikiquote.

And even when logged out at https://meta.wikimedia.org/wiki/Special:RecentChanges , so this is definitely "Unbreak now" material.

Can reproduce logged out now

Change 604386 merged by jenkins-bot:
[mediawiki/core@master] NamespaceInfo::makeValidNamespace: Don't throw for -1 or -2

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

Change 604675 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@wmf/1.35.0-wmf.36] NamespaceInfo::makeValidNamespace: Don't throw for -1 or -2

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

Change 604675 merged by jenkins-bot:
[mediawiki/core@wmf/1.35.0-wmf.36] NamespaceInfo::makeValidNamespace: Don't throw for -1 or -2

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

Mentioned in SAL (#wikimedia-operations) [2020-06-11T12:04:20Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.36/includes/title/NamespaceInfo.php: T253098 NamespaceInfo::makeValidNamespace: Don't throw for -1 or -2 (duration: 01m 06s)

Jdforrester-WMF lowered the priority of this task from Unbreak Now! to Medium.Jun 11 2020, 12:07 PM

Deeming this diversion into a UBN resolved; if people get a similar error but with a value that isn't an integer wrapped in a string, which is the real bug we're chasing, let's find that and fix that within this task. :-)

Jdforrester-WMF lowered the priority of this task from Medium to Low.

Still happening in wmf.39:

exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.39/includes/title/NamespaceInfo.php(196): NamespaceInfo->makeValidNamespace(string, string)
#1 /srv/mediawiki/php-1.35.0-wmf.39/includes/title/NamespaceInfo.php(186): NamespaceInfo->isTalk(string)
#2 /srv/mediawiki/php-1.35.0-wmf.39/includes/title/NamespaceInfo.php(311): NamespaceInfo->isSubject(string)
#3 /srv/mediawiki/php-1.35.0-wmf.39/includes/specialpage/ChangesListSpecialPage.php(1539): NamespaceInfo->getAssociated(string)
#4 [internal function]: ChangesListSpecialPage->{closure}(string)
#5 /srv/mediawiki/php-1.35.0-wmf.39/includes/specialpage/ChangesListSpecialPage.php(1545): array_map(Closure, array)
#6 /srv/mediawiki/php-1.35.0-wmf.39/includes/specialpage/ChangesListSpecialPage.php(1023): ChangesListSpecialPage->buildQuery(array, array, array, array, array, FormOptions)
#7 /srv/mediawiki/php-1.35.0-wmf.39/includes/specialpage/ChangesListSpecialPage.php(630): ChangesListSpecialPage->getRows()
#8 /srv/mediawiki/php-1.35.0-wmf.39/includes/specials/SpecialRecentChanges.php(165): ChangesListSpecialPage->execute(NULL)
#9 /srv/mediawiki/php-1.35.0-wmf.39/includes/specialpage/SpecialPage.php(580): SpecialRecentChanges->execute(NULL)
#10 /srv/mediawiki/php-1.35.0-wmf.39/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(NULL)
#11 /srv/mediawiki/php-1.35.0-wmf.39/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#12 /srv/mediawiki/php-1.35.0-wmf.39/includes/MediaWiki.php(986): MediaWiki->performRequest()
#13 /srv/mediawiki/php-1.35.0-wmf.39/includes/MediaWiki.php(543): MediaWiki->main()
#14 /srv/mediawiki/php-1.35.0-wmf.39/index.php(53): MediaWiki->run()
#15 /srv/mediawiki/php-1.35.0-wmf.39/index.php(46): wfIndexMain()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}

Change 608186 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/core@master] Filter invalid namespace on Special:RecentChanges and friend

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

Change 608186 merged by jenkins-bot:
[mediawiki/core@master] Filter invalid namespace on Special:RecentChanges and friend

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