Page MenuHomePhabricator

ApiQueryGlobalUsage.php Undefined index error when accessing $pageIds
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.9

message
PHP Notice: Undefined index: 94thpedal.JPG

Impact

Occasional bursts of screen fulls of these errors in logspam-watch output.

Notes

Details

Request ID
fbe907c0-ede4-460d-b40c-fd7dfa543d70
Request URL
https://commons.wikimedia.org/w/api.php?action=query&titles=File:94&format=json&prop=globalusage&gusite=enwiki%7Cenwikibooks%7Cenwikinews%7Cenwikiquote%7Cenwikisource%7Cenwikiversity%7Cenwikivoyage%7Cenwiktionary&guprop=pageid%7Curl&gulimit=500
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.36.0-wmf.9/extensions/GlobalUsage/includes/ApiQueryGlobalUsage.php(57): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.36.0-wmf.9/includes/api/ApiQuery.php(263): ApiQueryGlobalUsage->execute()
#2 /srv/mediawiki/php-1.36.0-wmf.9/includes/api/ApiMain.php(1600): ApiQuery->execute()
#3 /srv/mediawiki/php-1.36.0-wmf.9/includes/api/ApiMain.php(536): ApiMain->executeAction()
#4 /srv/mediawiki/php-1.36.0-wmf.9/includes/api/ApiMain.php(507): ApiMain->executeActionWithErrorHandling()
#5 /srv/mediawiki/php-1.36.0-wmf.9/api.php(90): ApiMain->execute()
#6 /srv/mediawiki/php-1.36.0-wmf.9/api.php(45): wfApiMain()
#7 /srv/mediawiki/w/api.php(3): require(string)
#8 {main}

Event Timeline

mmodell subscribed.

added as blocker even though this isn't new. It's currently the highest frequency logspam in kibana.

thcipriani raised the priority of this task from Low to Unbreak Now!.Sep 23 2020, 3:31 PM
thcipriani subscribed.

train blockers are UBNs

So the code in question appears to be ok, I think something changed in the code it's calling so the assumption that pageId would be valid is no longer valid.

Requests are generating a lot of noise here. For example the 1 request-id in this task generated 164 notices https://logstash.wikimedia.org/goto/0aa65e4883b273a1497897615ab6a081

Change 629391 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/GlobalUsage@master] ApiQueryGlobalUsage: handle undefined indexes

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

Change 629399 had a related patch set uploaded (by Ahmon Dancy; owner: DannyS712):
[mediawiki/extensions/GlobalUsage@wmf/1.36.0-wmf.10] ApiQueryGlobalUsage: handle undefined indexes

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

Change 629391 merged by jenkins-bot:
[mediawiki/extensions/GlobalUsage@master] ApiQueryGlobalUsage: handle undefined indexes

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

Change 629399 merged by jenkins-bot:
[mediawiki/extensions/GlobalUsage@wmf/1.36.0-wmf.10] ApiQueryGlobalUsage: handle undefined indexes

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

Mentioned in SAL (#wikimedia-operations) [2020-09-23T20:42:50Z] <dancy> dancy@deploy1001 Started scap: Deploying fixes for T263601 and T263675 to 1.36.0-wmf.10

ApiQueryGlobalUsage::execute() has been modified to defend against the undefined index error but the root cause has not been resolved.

Jdforrester-WMF lowered the priority of this task from Unbreak Now! to Needs Triage.Sep 29 2020, 7:38 PM
Jdforrester-WMF subscribed.

Production breakage / train blocker part resolved, so de-escalating.

Change 636148 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/GlobalUsage@master] Fix database query from api for number-only titles

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

The bad query can also results in WMFTimeoutException, I have produce one while looking at this bug. If you found it in the logs/logstash, there is no need to report.

Change 636148 merged by jenkins-bot:
[mediawiki/extensions/GlobalUsage@master] Fix database query from api for number-only titles

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

Umherirrender claimed this task.