Page MenuHomePhabricator

"PHP Notice: Undefined index: 810" from ApiQuerySiteinfo
Closed, ResolvedPublic

Description

Error

Request ID: W7PWswrAACoAADCD338AAAAX

message
PHP Notice: Undefined index: 810
stacktrace
#0 /srv/mediawiki/php-1.32.0-wmf.24/includes/api/ApiQuerySiteinfo.php(324): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.32.0-wmf.24/includes/api/ApiQuerySiteinfo.php(48): ApiQuerySiteinfo->appendNamespaceAliases(string)
#2 /srv/mediawiki/php-1.32.0-wmf.24/includes/api/ApiQuery.php(249): ApiQuerySiteinfo->execute()
#3 /srv/mediawiki/php-1.32.0-wmf.24/includes/api/ApiMain.php(1587): ApiQuery->execute()
#4 /srv/mediawiki/php-1.32.0-wmf.24/includes/api/ApiMain.php(531): ApiMain->executeAction()
#5 /srv/mediawiki/php-1.32.0-wmf.24/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#6 /srv/mediawiki/php-1.32.0-wmf.24/api.php(87): ApiMain->execute()

Notes

Quite spammy, from various API requests to testwiki, testwikidatawiki, and mediawiki.org. Started right after 1.32-wmf.24 rolled out to group0, not seen in the 30 days prior. Marking as UBN.

Details

Event Timeline

Krinkle created this task.Oct 2 2018, 8:41 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 2 2018, 8:41 PM
Anomie added a subscriber: Anomie.

Nothing has changed in ApiQuerySiteInfo since 1.32.0-wmf.18.

On testwiki,

hphpd> =$wgContLang->getNamespaceAliases();
=$wgContLang->getNamespaceAliases();
Array
(
    [Judgement] => 810
    [Judgement_talk] => 811
)

hphpd> =$wgContLang->getNamespaces();
=$wgContLang->getNamespaces();
Array
(
    [-2] => "Media"
    [-1] => "Special"
    [0] => ""
    [1] => "Talk"
    [2] => "User"
    [3] => "User_talk"
    [4] => "Wikipedia"
    [5] => "Wikipedia_talk"
    [6] => "File"
    [7] => "File_talk"
    [8] => "MediaWiki"
    [9] => "MediaWiki_talk"
    [10] => "Template"
    [11] => "Template_talk"
    [12] => "Help"
    [13] => "Help_talk"
    [14] => "Category"
    [15] => "Category_talk"
    [90] => "Thread"
    [91] => "Thread_talk"
    [92] => "Summary"
    [93] => "Summary_talk"
    [118] => "Draft"
    [119] => "Draft_talk"
    [460] => "Campaign"
    [461] => "Campaign_talk"
    [710] => "TimedText"
    [711] => "TimedText_talk"
    [828] => "Module"
    [829] => "Module_talk"
    [830] => "SecurePoll"
    [831] => "SecurePoll_talk"
    [866] => "CNBanner"
    [867] => "CNBanner_talk"
    [1198] => "Translations"
    [1199] => "Translations_talk"
    [2300] => "Gadget"
    [2301] => "Gadget_talk"
    [2302] => "Gadget_definition"
    [2303] => "Gadget_definition_talk"
    [2600] => "Topic"
    [5500] => "Newsletter"
    [5501] => "Newsletter_talk"
)

What's defining aliases for namespaces 810 and 811 when those namespaces aren't defined?

Anomie added a project: Jade.EditedOct 2 2018, 8:59 PM
Anomie added subscribers: awight, Ladsgroup.

Looks like the answer is Jade, due to rEJADe74405d81b4a: Add a namespace alias for "judgement" in English and rEJADdbbe71c83558: Add another namespace alias for the "Judgement_talk" spelling.

Although I'm not immediately seeing what it's doing wrong that's making the aliases be loaded when the extension itself isn't.

Anomie added a comment.Oct 2 2018, 9:22 PM

I note that trying to visit https://test.wikipedia.org/wiki/Judgement:Foo redirects to https://test.wikipedia.org/wiki/Special:Badtitle/NS810:Foo, to display a bad title error.

It looks like no other extension is defining any namespace aliases via an ExtensionMessagesFiles file, and our localization cache logic is pulling in those files from all extensions whether they're loaded on the wiki or not (because the cache isn't separated per wiki).

Probably the solution is to have Language::getNamespaceAliases() filter out aliases to namespaces that aren't defined on the wiki.

Change 464053 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] Language: Don't return aliases to namespaces that don't exist

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

awight added a comment.Oct 2 2018, 9:31 PM

Thanks for the fix and apologies for having invented a non-standard way to provide the namespace aliases…

Anomie added a comment.Oct 2 2018, 9:32 PM

I think it's more that you just started using a feature that has either never been used or hasn't been used in a long time, so you uncovered a bug.

Change 464053 merged by jenkins-bot:
[mediawiki/core@master] Language: Don't return aliases to namespaces that don't exist

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

Change 464093 had a related patch set uploaded (by Krinkle; owner: Anomie):
[mediawiki/core@wmf/1.32.0-wmf.24] Language: Don't return aliases to namespaces that don't exist

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

Change 464093 merged by jenkins-bot:
[mediawiki/core@wmf/1.32.0-wmf.24] Language: Don't return aliases to namespaces that don't exist

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

Mentioned in SAL (#wikimedia-operations) [2018-10-03T05:24:20Z] <krinkle@deploy1001> Synchronized php-1.32.0-wmf.24/languages/Language.php: T206030 - I985dfa3eb17 (duration: 00m 56s)

zeljkofilipin triaged this task as Unbreak Now! priority.Oct 3 2018, 2:55 PM

Because it's blocking the train.

Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptOct 3 2018, 2:55 PM
Krinkle closed this task as Resolved.Oct 3 2018, 3:17 PM
Krinkle claimed this task.

No longer in the logs after the above patch was deployed yesterday.

[{exception_id}] {exception_url} ErrorException from line 324 of /srv/mediawiki/php-1.32.0-wmf.24/includes/api/ApiQuerySiteinfo.php: PHP Notice: Undefined index: 810
[{exception_id}] {exception_url} ErrorException from line 324 of /srv/mediawiki/php-1.32.0-wmf.24/includes/api/ApiQuerySiteinfo.php: PHP Notice: Undefined index: 811
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM