Page MenuHomePhabricator

API / GlobalBlocks: PHP Notice: Undefined property: stdClass::$gb_timestamp
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.35.0-wmf.28

message
PHP Notice: Undefined property: stdClass::$gb_timestamp

Impact

Just saw a spike of ~1k of these warnings starting at 2020-04-29 16:47:51 UTC, all on enwiki.

Details

Request ID
08aa9363-c159-4a82-ae54-f41d70e33882
Request URL
https://en.wikipedia.org/w/api.php
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.28/extensions/GlobalBlocking/includes/api/ApiQueryGlobalBlocks.php(148): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.35.0-wmf.28/includes/api/ApiQuery.php(263): ApiQueryGlobalBlocks->execute()
#2 /srv/mediawiki/php-1.35.0-wmf.28/includes/api/ApiMain.php(1580): ApiQuery->execute()
#3 /srv/mediawiki/php-1.35.0-wmf.28/includes/api/ApiMain.php(523): ApiMain->executeAction()
#4 /srv/mediawiki/php-1.35.0-wmf.28/includes/api/ApiMain.php(494): ApiMain->executeActionWithErrorHandling()
#5 /srv/mediawiki/php-1.35.0-wmf.28/api.php(84): ApiMain->execute()
#6 /srv/mediawiki/w/api.php(3): require(string)
#7 {main}

Event Timeline

brennen renamed this task from PHP Notice: Undefined property: stdClass::$gb_timestamp to API / GlobaBlocks: PHP Notice: Undefined property: stdClass::$gb_timestamp.Apr 29 2020, 5:22 PM
brennen updated the task description. (Show Details)
brennen moved this task from Backlog to Logs/Train on the User-brennen board.
Krinkle renamed this task from API / GlobaBlocks: PHP Notice: Undefined property: stdClass::$gb_timestamp to API / GlobalBlocks: PHP Notice: Undefined property: stdClass::$gb_timestamp.Apr 29 2020, 6:30 PM

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/GlobalBlocking/+/master/includes/api/ApiQueryGlobalBlocks.php#148

So… $row is stdClass; $res is an IResultWrapper of nominal stdClasss which are actually injected by Database as proper results normally, aren't they?

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/GlobalBlocking/+/master/includes/api/ApiQueryGlobalBlocks.php#148

So… $row is stdClass; $res is an IResultWrapper of nominal stdClasss which are actually injected by Database as proper results normally, aren't they?

It's being unconditionally used... but only conditionally selected - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/GlobalBlocking/+/master/includes/api/ApiQueryGlobalBlocks.php#73

Change 593305 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/GlobalBlocking@master] Unconditionally select gb_timestamp

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

So basically, it works fine if someone explicitly selects it, or if they don't change the default properties (as per https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/GlobalBlocking/+blame/master/includes/api/ApiQueryGlobalBlocks.php#220), but if they do, it'll error out

Confirmed by making entries in logstash appear on demand that https://en.wikipedia.org/w/api.php?action=query&list=globalblocks&bgprop=address&bglimit=max does it, even though no error appears to the end user

"continue": {
    "bgstart": "2020-04-29T20:26:30Z",
    "continue": "-||"
},

I don't know if we want to bother to backport to prod branches... It's not a recent regression, just no one has hit the specific parameters recently...

Screenshot 2020-04-29 at 21.36.47.png (374×1 px, 43 KB)

Change 593307 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/GlobalBlocking@REL1_34] Unconditionally select gb_timestamp

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

Change 593308 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/GlobalBlocking@REL1_33] Unconditionally select gb_timestamp

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

Change 593309 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/GlobalBlocking@REL1_31] Unconditionally select gb_timestamp

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

Change 593307 merged by jenkins-bot:
[mediawiki/extensions/GlobalBlocking@REL1_34] Unconditionally select gb_timestamp

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

Change 593311 had a related patch set uploaded (by Jforrester; owner: Reedy):
[mediawiki/extensions/GlobalBlocking@wmf/1.35.0-wmf.30] Unconditionally select gb_timestamp

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

Change 593308 merged by jenkins-bot:
[mediawiki/extensions/GlobalBlocking@REL1_33] Unconditionally select gb_timestamp

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

Change 593305 merged by jenkins-bot:
[mediawiki/extensions/GlobalBlocking@master] Unconditionally select gb_timestamp

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

Change 593309 merged by jenkins-bot:
[mediawiki/extensions/GlobalBlocking@REL1_31] Unconditionally select gb_timestamp

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

Change 593311 merged by jenkins-bot:
[mediawiki/extensions/GlobalBlocking@wmf/1.35.0-wmf.30] Unconditionally select gb_timestamp

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

Reedy claimed this task.

Change 593322 had a related patch set uploaded (by Jforrester; owner: Reedy):
[mediawiki/extensions/GlobalBlocking@wmf/1.35.0-wmf.28] Unconditionally select gb_timestamp

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

Mentioned in SAL (#wikimedia-operations) [2020-04-29T21:19:01Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.30/extensions/GlobalBlocking/includes/api/ApiQueryGlobalBlocks.php: T251430 Unconditionally select gb_timestamp (duration: 01m 05s)

I don't know if we want to bother to backport to prod branches... It's not a recent regression, just no one has hit the specific parameters recently...

Screenshot 2020-04-29 at 21.36.47.png (374×1 px, 43 KB)

Yes, but they're hitting it an awful lot.

Change 593322 merged by jenkins-bot:
[mediawiki/extensions/GlobalBlocking@wmf/1.35.0-wmf.28] Unconditionally select gb_timestamp

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

Mentioned in SAL (#wikimedia-operations) [2020-04-29T21:22:18Z] <jforrester@deploy1001> Synchronized php-1.35.0-wmf.28/extensions/GlobalBlocking/includes/api/ApiQueryGlobalBlocks.php: T251430 Unconditionally select gb_timestamp (duration: 01m 06s)