Page MenuHomePhabricator

PHP Notice: Trying to access array offset on value of type null
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Notice: Trying to access array offset on value of type null
exception.trace
from /srv/mediawiki/php-1.40.0-wmf.10/extensions/GlobalBlocking/includes/GlobalBlocking.php(590)
#0 /srv/mediawiki/php-1.40.0-wmf.10/extensions/GlobalBlocking/includes/GlobalBlocking.php(590): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.40.0-wmf.10/extensions/GlobalBlocking/includes/Api/ApiGlobalBlock.php(52): MediaWiki\Extension\GlobalBlocking\GlobalBlocking::block(string, string, string, User, array)
#2 /srv/mediawiki/php-1.40.0-wmf.10/includes/api/ApiMain.php(1902): MediaWiki\Extension\GlobalBlocking\Api\ApiGlobalBlock->execute()
#3 /srv/mediawiki/php-1.40.0-wmf.10/includes/api/ApiMain.php(877): ApiMain->executeAction()
#4 /srv/mediawiki/php-1.40.0-wmf.10/includes/api/ApiMain.php(848): ApiMain->executeActionWithErrorHandling()
#5 /srv/mediawiki/php-1.40.0-wmf.10/api.php(90): ApiMain->execute()
#6 /srv/mediawiki/php-1.40.0-wmf.10/api.php(45): wfApiMain()
#7 /srv/mediawiki/w/api.php(3): require(string)
#8 {main}
Impact
Notes

Seen 94 times on Nov 30 around 15:00 UTC on meta. Maybe some automated script/bot triggered this path many times.

Event Timeline

$blockId = $status->getValue()['id']; is used before checking $status->isOK(), so it should be a simple fix. This regressed in r824578 (for T310390).

Change 862285 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/GlobalBlocking@master] Fix PHP notice

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

Change 861484 had a related patch set uploaded (by Ladsgroup; author: Daimona Eaytoy):

[mediawiki/extensions/GlobalBlocking@wmf/1.40.0-wmf.12] Fix PHP notice

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

Change 861484 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@wmf/1.40.0-wmf.12] Fix PHP notice

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

Change 861485 had a related patch set uploaded (by Ladsgroup; author: Daimona Eaytoy):

[mediawiki/extensions/GlobalBlocking@wmf/1.40.0-wmf.10] Fix PHP notice

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

Mentioned in SAL (#wikimedia-operations) [2022-11-30T19:27:57Z] <ladsgroup@deploy1002> Started scap: Backport for [[gerrit:861484|Fix PHP notice (T324119)]]

Change 862285 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Fix PHP notice

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

Mentioned in SAL (#wikimedia-operations) [2022-11-30T19:29:05Z] <ladsgroup@deploy1002> ladsgroup and ladsgroup: Backport for [[gerrit:861484|Fix PHP notice (T324119)]] synced to the testservers: mwdebug1002.eqiad.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug2002.codfw.wmnet

Change 861485 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@wmf/1.40.0-wmf.10] Fix PHP notice

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

Mentioned in SAL (#wikimedia-operations) [2022-11-30T19:33:48Z] <ladsgroup@deploy1002> Finished scap: Backport for [[gerrit:861484|Fix PHP notice (T324119)]] (duration: 05m 50s)

Mentioned in SAL (#wikimedia-operations) [2022-11-30T19:34:26Z] <ladsgroup@deploy1002> Started scap: Backport for [[gerrit:861485|Fix PHP notice (T324119)]]

Mentioned in SAL (#wikimedia-operations) [2022-11-30T19:35:32Z] <ladsgroup@deploy1002> ladsgroup and ladsgroup: Backport for [[gerrit:861485|Fix PHP notice (T324119)]] synced to the testservers: mwdebug1002.eqiad.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug2001.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2022-11-30T19:39:58Z] <ladsgroup@deploy1002> Finished scap: Backport for [[gerrit:861485|Fix PHP notice (T324119)]] (duration: 05m 32s)

dancy added subscribers: Ladsgroup, dancy.

The errors have gone away. Thank you @Daimona and @Ladsgroup !