Page MenuHomePhabricator

Assert.php: Bad value for parameter $responses: must have as many responses as requests
Closed, ResolvedPublic

Description

Error

Request ID: XV6zXgpAAEkAAG3qDG4AAAFA
Request URL: zh.wikipedia.org/w/api.php...

message
[XV6zXgpAAEkAAG3qDG4AAAFA] /w/api.php?action=query&format=json&formatversion=2&prop=pageimages%7Cdescription&piprop=thumbnail&pithumbsize=160&pilimit=3&generator=search&gsrsearch=morelike%3A%E4%B8%89%E5%8F%A0%E5%AD%97&gsrnamespace=0&gsrlimit=3&gsrqiprofile=classic_noboostlinks&uselang=content&smaxage=86400&maxage=86400   Wikimedia\Assert\ParameterAssertionException from line 63 of /srv/mediawiki/php-1.34.0-wmf.19/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $responses: must have as many responses as requests
trace
#0 /srv/mediawiki/php-1.34.0-wmf.19/extensions/CirrusSearch/includes/Search/MSearchRequests.php(56): Wikimedia\Assert\Assert::parameter(boolean, string, string)
#1 /srv/mediawiki/php-1.34.0-wmf.19/extensions/CirrusSearch/includes/Searcher.php(631): CirrusSearch\Search\MSearchRequests->toMSearchResponses(array)
#2 /srv/mediawiki/php-1.34.0-wmf.19/extensions/CirrusSearch/includes/Searcher.php(322): CirrusSearch\Searcher->searchMulti(CirrusSearch\Search\MSearchRequests)
#3 /srv/mediawiki/php-1.34.0-wmf.19/extensions/CirrusSearch/includes/Searcher.php(184): CirrusSearch\Searcher->searchTextInternal(string)
#4 /srv/mediawiki/php-1.34.0-wmf.19/extensions/CirrusSearch/includes/CirrusSearch.php(228): CirrusSearch\Searcher->search(CirrusSearch\Search\SearchQuery)
#5 /srv/mediawiki/php-1.34.0-wmf.19/extensions/CirrusSearch/includes/CirrusSearch.php(201): CirrusSearch\CirrusSearch->searchTextReal(CirrusSearch\Search\SearchQuery)
#6 /srv/mediawiki/php-1.34.0-wmf.19/includes/search/SearchEngine.php(86): CirrusSearch\CirrusSearch->doSearchText(string)
#7 /srv/mediawiki/php-1.34.0-wmf.19/includes/search/SearchEngine.php(172): Closure$SearchEngine::searchText()
#8 /srv/mediawiki/php-1.34.0-wmf.19/includes/search/SearchEngine.php(87): SearchEngine->maybePaginate(Closure$SearchEngine::searchText;2929)
#9 /srv/mediawiki/php-1.34.0-wmf.19/includes/api/ApiQuerySearch.php(98): SearchEngine->searchText(string)
#10 /srv/mediawiki/php-1.34.0-wmf.19/includes/api/ApiQuerySearch.php(43): ApiQuerySearch->run(ApiPageSet)
#11 /srv/mediawiki/php-1.34.0-wmf.19/includes/api/ApiPageSet.php(176): ApiQuerySearch->executeGenerator(ApiPageSet)
#12 /srv/mediawiki/php-1.34.0-wmf.19/includes/api/ApiPageSet.php(140): ApiPageSet->executeInternal(boolean)
#13 /srv/mediawiki/php-1.34.0-wmf.19/includes/api/ApiQuery.php(235): ApiPageSet->execute()
#14 /srv/mediawiki/php-1.34.0-wmf.19/includes/api/ApiMain.php(1589): ApiQuery->execute()
#15 /srv/mediawiki/php-1.34.0-wmf.19/includes/api/ApiMain.php(533): ApiMain->executeAction()
#16 /srv/mediawiki/php-1.34.0-wmf.19/includes/api/ApiMain.php(504): ApiMain->executeActionWithErrorHandling()
#17 /srv/mediawiki/php-1.34.0-wmf.19/api.php(86): ApiMain->execute()
#18 /srv/mediawiki/w/api.php(3): include(string)
#19 {main}
Impact

13 hits in the last day, 452 in the last 30 days.

Notes

Happening since at least wmf.15, I didn't look further. Not blocking the train since it's not new.

Event Timeline

Restricted Application added subscribers: Cosine02, Aklapper. · View Herald TranscriptAug 22 2019, 3:31 PM
Restricted Application added a project: Discovery-Search. · View Herald TranscriptAug 22 2019, 3:32 PM
EBernhardson triaged this task as Medium priority.Aug 22 2019, 4:55 PM
EBernhardson moved this task from needs triage to elastic / cirrus on the Discovery-Search board.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:06 PM

@dcausse as a percentage of requests this is exceptionally low, but suggests we are missing some edge case. Any ideas?

I suspect some edge cases in how we manage the query cache? Most of the errors seem to involve morelike.

Change 535199 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Ignore incoherent cached responses

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

dcausse claimed this task.Sep 9 2019, 2:25 PM
dcausse moved this task from In Progress to Waiting on the Discovery-Search (Current work) board.

moving to waiting time to collect more logs.

Change 535199 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Ignore incoherent cached responses

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

Change 539350 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Log the response object when the number of responses is incoherent

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

Change 539350 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Log the response object when the number of responses is incoherent

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

TJones closed this task as Resolved.Nov 6 2019, 5:35 PM