Page MenuHomePhabricator

ErrorException from line 125 of ApiQueryQueryPage.php: PHP Notice: Undefined property: stdClass::$value
Closed, ResolvedPublic

Description

Similar to T33759: Undefined property notice in querypages API (?)

exception.file	       	/srv/mediawiki/php-1.34.0-wmf.8/includes/api/ApiQueryQueryPage.php:125
exception.message	       	PHP Notice: Undefined property: stdClass::$value
exception.trace	       	#0 /srv/mediawiki/php-1.34.0-wmf.8/includes/api/ApiQueryQueryPage.php(125): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.34.0-wmf.8/includes/api/ApiQueryQueryPage.php(53): ApiQueryQueryPage->run()
#2 /srv/mediawiki/php-1.34.0-wmf.8/includes/api/ApiQuery.php(249): ApiQueryQueryPage->execute()
#3 /srv/mediawiki/php-1.34.0-wmf.8/includes/api/ApiMain.php(1595): ApiQuery->execute()
#4 /srv/mediawiki/php-1.34.0-wmf.8/includes/api/ApiMain.php(531): ApiMain->executeAction()
#5 /srv/mediawiki/php-1.34.0-wmf.8/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#6 /srv/mediawiki/php-1.34.0-wmf.8/api.php(87): ApiMain->execute()
#7 /srv/mediawiki/w/api.php(3): include(string)
#8 {main}
exception_id	       	XQOWfApAEDQAAHhRBggAAABM
exception_url	       	/w/api.php?action=query&list=querypage&qppage=IndexPages&format=json&qplimit=500&qpoffset=500

Details

Related Gerrit Patches:
mediawiki/extensions/ProofreadPage : wmf/1.34.0-wmf.10Use value for sorting results in SpecialProofreadPages
mediawiki/extensions/ProofreadPage : masterUse value for sorting results in SpecialProofreadPages

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 14 2019, 12:54 PM
Krinkle added a subscriber: Krinkle.

From IRC:

See https://github.com/wikimedia/mediawiki/blob/61544d6eb2353/includes/api/ApiQueryQueryPage.php#L125
during cache look up, core QueryPage.php ensures presence of value (falling back to null, per table default) but during
raw fetch, it's up to the original query.
And for ProofreadPage, it's not selecting any value field - https://github.com/wikimedia/mediawiki-extensions-ProofreadPage/blob/fb1b06269afef0a7d424774992e729c46852fe42/includes/Special/SpecialProofreadPages.php#L211

The following might work:

  1. Core should either detect this error and throw an exception to refuse the query if the three required fields are missing from $query['fields'], or, core should make it work without value, e.g. by adding NULL as value or some such if missing.
  2. If solved with an exception, then ProofreadPage will still need to be fixed to actually provide a value column.
Reedy renamed this task from ErrorException from line 125 of /srv/mediawiki/php-1.34.0-wmf.8/includes/api/ApiQueryQueryPage.php: PHP Notice: Undefined property: stdClass::$value to ErrorException from line 125 of ApiQueryQueryPage.php: PHP Notice: Undefined property: stdClass::$value.Jun 14 2019, 10:28 PM

This has produced 2M errors in the last 24h.

Tpt added a subscriber: Tpt.Jun 17 2019, 7:34 PM

QueryPage was supposed to use the returned values of QueryPage::getOrderFields() to sort the results instead of value. it seems that recent code dropped partially this feature. Adding back the full support of QueryPage::getOrderFields() or, at least, strongly deprecate it seems the proper way to go.

Change 517717 had a related patch set uploaded (by Tpt; owner: Tpt):
[mediawiki/extensions/ProofreadPage@master] Use value for sorting results in SpecialProofreadPages

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

Change 517782 had a related patch set uploaded (by Krinkle; owner: Tpt):
[mediawiki/extensions/ProofreadPage@wmf/1.34.0-wmf.10] Use value for sorting results in SpecialProofreadPages

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

Change 517717 merged by jenkins-bot:
[mediawiki/extensions/ProofreadPage@master] Use value for sorting results in SpecialProofreadPages

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

Change 517782 merged by jenkins-bot:
[mediawiki/extensions/ProofreadPage@wmf/1.34.0-wmf.10] Use value for sorting results in SpecialProofreadPages

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

Mentioned in SAL (#wikimedia-operations) [2019-06-24T22:56:55Z] <krinkle@deploy1001> Synchronized php-1.34.0-wmf.10/extensions/ProofreadPage/includes/Special/SpecialProofreadPages.php: ed556868f / T225813 (duration: 00m 53s)

Krinkle closed this task as Resolved.Jun 24 2019, 11:01 PM
Krinkle assigned this task to Tpt.
Krinkle triaged this task as High priority.
Krinkle removed a project: Patch-For-Review.
Krinkle added subscribers: mobrovac, Anomie.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:06 PM