Page MenuHomePhabricator

Argument 1 passed to WikibaseQuality\ConstraintReport\ConstraintCheck\Cache\CachedArray::__construct() must be of the type array, null given, called in /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/Helper/SparqlHelper.php on line 783
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.5

message
Argument 1 passed to WikibaseQuality\ConstraintReport\ConstraintCheck\Cache\CachedArray::__construct() must be of the type array, null given, called in /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/Helper/SparqlHelper.php on line 783

Impact

  • This seems to be _very_ rare, only a single event in the last 30 days and the code seems to be from 2017

Notes

  • the error stems from the json of the request not being correctly decoded. Either it is invalid or too deeply nested.
  • probably we should just catch it and log it

Details

Request ID
3e5419da-5e82-4e34-9197-db6cbad3191f
Request URL
https://www.wikidata.org/w/api.php?action=wbcheckconstraints&format=json&formatversion=2&uselang=es&id=Q889914&status=violation%7Cwarning%7Csuggestion%7Cbad-parameters
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/Helper/SparqlHelper.php(783): WikibaseQuality\ConstraintReport\ConstraintCheck\Cache\CachedArray->__construct(NULL, WikibaseQuality\ConstraintReport\ConstraintCheck\Cache\Metadata)
#1 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/Helper/SparqlHelper.php(303): WikibaseQuality\ConstraintReport\ConstraintCheck\Helper\SparqlHelper->runQuery(string)
#2 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/Checker/UniqueValueChecker.php(79): WikibaseQuality\ConstraintReport\ConstraintCheck\Helper\SparqlHelper->findEntitiesWithSameStatement(Wikibase\DataModel\Statement\Statement, boolean)
#3 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/DelegatingConstraintChecker.php(566): WikibaseQuality\ConstraintReport\ConstraintCheck\Checker\UniqueValueChecker->checkConstraint(WikibaseQuality\ConstraintReport\ConstraintCheck\Context\MainSnakContext, WikibaseQuality\ConstraintReport\Constraint)
#4 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/DelegatingConstraintChecker.php(460): WikibaseQuality\ConstraintReport\ConstraintCheck\DelegatingConstraintChecker->getCheckResultFor(WikibaseQuality\ConstraintReport\ConstraintCheck\Context\MainSnakContext, WikibaseQuality\ConstraintReport\Constraint)
#5 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/DelegatingConstraintChecker.php(374): WikibaseQuality\ConstraintReport\ConstraintCheck\DelegatingConstraintChecker->checkConstraintsForMainSnak(Wikibase\DataModel\Entity\Item, Wikibase\DataModel\Statement\Statement, NULL, array)
#6 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/DelegatingConstraintChecker.php(346): WikibaseQuality\ConstraintReport\ConstraintCheck\DelegatingConstraintChecker->checkStatement(Wikibase\DataModel\Entity\Item, Wikibase\DataModel\Statement\Statement, NULL, array)
#7 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/ConstraintCheck/DelegatingConstraintChecker.php(154): WikibaseQuality\ConstraintReport\ConstraintCheck\DelegatingConstraintChecker->checkEveryStatement(Wikibase\DataModel\Entity\Item, NULL, array)
#8 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/Api/CheckingResultsSource.php(53): WikibaseQuality\ConstraintReport\ConstraintCheck\DelegatingConstraintChecker->checkAgainstConstraintsOnEntityId(Wikibase\DataModel\Entity\ItemId, NULL, array, array)
#9 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/Api/CachingResultsSource.php(235): WikibaseQuality\ConstraintReport\Api\CheckingResultsSource->getResults(array, array, NULL, array)
#10 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/Api/CachingResultsSource.php(167): WikibaseQuality\ConstraintReport\Api\CachingResultsSource->getAndStoreResults(array, array, NULL, array)
#11 /srv/mediawiki/php-1.36.0-wmf.5/extensions/WikibaseQualityConstraints/src/Api/CheckConstraints.php(172): WikibaseQuality\ConstraintReport\Api\CachingResultsSource->getResults(array, array, NULL, array)
#12 /srv/mediawiki/php-1.36.0-wmf.5/includes/api/ApiMain.php(1593): WikibaseQuality\ConstraintReport\Api\CheckConstraints->execute()
#13 /srv/mediawiki/php-1.36.0-wmf.5/includes/api/ApiMain.php(529): ApiMain->executeAction()
#14 /srv/mediawiki/php-1.36.0-wmf.5/includes/api/ApiMain.php(500): ApiMain->executeActionWithErrorHandling()
#15 /srv/mediawiki/php-1.36.0-wmf.5/api.php(90): ApiMain->execute()
#16 /srv/mediawiki/php-1.36.0-wmf.5/api.php(45): wfApiMain()
#17 /srv/mediawiki/w/api.php(3): require(string)
#18 {main}

Event Timeline

Michael created this task.Aug 21 2020, 9:45 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 21 2020, 9:45 AM

Change 621699 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Handle and track JSON errors in SparqlHelper

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

Change 621699 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Handle and track JSON errors in SparqlHelper

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

Lucas_Werkmeister_WMDE closed this task as Resolved.Sep 16 2020, 4:25 PM
Lucas_Werkmeister_WMDE claimed this task.

I think we can close this. Because it’s such a rare error condition, there aren’t any wikibase.quality.constraints.sparql.error.json.* metrics in Graphite yet, but there haven’t been any new occurrences of the error in logstash either, so I assume it probably works.