Page MenuHomePhabricator

OtherIndexesUpdater.php: PHP Warning: Invalid argument supplied for foreach()
Closed, ResolvedPublic

Description

110 fatal errors on logstash-beta in the last 12 hours of type: [{exception_id}] {exception_url} ErrorException from line 85 of /srv/mediawiki/php-master/extensions/CirrusSearch/includes/OtherIndexesUpdater.php: PHP Warning: Invalid argument supplied for foreach(): https://kibana4.wmflabs.org/goto/8db611ae2ec55e4ff1fb338c532bad81

Latest error:

message
[XSB0WKwQBGoAAFheMecAAAAS] /w/api.php?generator=search&meta=userinfo&inprop=protection&iiprop=timestamp%7Cuser%7Ccomment%7Curl%7Csize%7Csha1%7Cmetadata&action=query&iilimit=max&gsrsearch=word&gsrnamespace=5%7C6%7C7&prop=categoryinfo%7Cimageinfo%7Cinfo%7Cproofread&gsrwhat=text&maxlag=5&format=json&continue=&indexpageids=&uiprop=blockinfo%7Chasmsg&gsrlimit=5   ErrorException from line 85 of /srv/mediawiki/php-master/extensions/CirrusSearch/includes/OtherIndexesUpdater.php: PHP Warning: Invalid argument supplied for foreach()
trace
#0 /srv/mediawiki/php-master/extensions/CirrusSearch/includes/OtherIndexesUpdater.php(85): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-master/extensions/CirrusSearch/includes/Search/SearchContext.php(734): CirrusSearch\OtherIndexesUpdater::getExtraIndexesForNamespaces(CirrusSearch\SearchConfig, array)
#2 /srv/mediawiki/php-master/extensions/CirrusSearch/includes/Search/SearchRequestBuilder.php(56): CirrusSearch\Search\SearchContext->getExtraIndices()
#3 /srv/mediawiki/php-master/extensions/CirrusSearch/includes/Searcher.php(466): CirrusSearch\Search\SearchRequestBuilder->build()
#4 /srv/mediawiki/php-master/extensions/CirrusSearch/includes/Searcher.php(304): CirrusSearch\Searcher->buildSearch()
#5 /srv/mediawiki/php-master/extensions/CirrusSearch/includes/Searcher.php(180): CirrusSearch\Searcher->searchTextInternal(string)
#6 /srv/mediawiki/php-master/extensions/CirrusSearch/includes/CirrusSearch.php(228): CirrusSearch\Searcher->search(CirrusSearch\Search\SearchQuery)
#7 /srv/mediawiki/php-master/extensions/CirrusSearch/includes/CirrusSearch.php(201): CirrusSearch\CirrusSearch->searchTextReal(CirrusSearch\Search\SearchQuery)
#8 /srv/mediawiki/php-master/includes/search/SearchEngine.php(86): CirrusSearch\CirrusSearch->doSearchText(string)
#9 /srv/mediawiki/php-master/includes/search/SearchEngine.php(172): Closure$SearchEngine::searchText()
#10 /srv/mediawiki/php-master/includes/search/SearchEngine.php(87): SearchEngine->maybePaginate(Closure$SearchEngine::searchText;7764)
#11 /srv/mediawiki/php-master/includes/api/ApiQuerySearch.php(76): SearchEngine->searchText(string)
#12 /srv/mediawiki/php-master/includes/api/ApiQuerySearch.php(43): ApiQuerySearch->run(ApiPageSet)
#13 /srv/mediawiki/php-master/includes/api/ApiPageSet.php(176): ApiQuerySearch->executeGenerator(ApiPageSet)
#14 /srv/mediawiki/php-master/includes/api/ApiPageSet.php(140): ApiPageSet->executeInternal(boolean)
#15 /srv/mediawiki/php-master/includes/api/ApiQuery.php(235): ApiPageSet->execute()
#16 /srv/mediawiki/php-master/includes/api/ApiMain.php(1583): ApiQuery->execute()
#17 /srv/mediawiki/php-master/includes/api/ApiMain.php(531): ApiMain->executeAction()
#18 /srv/mediawiki/php-master/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#19 /srv/mediawiki/php-master/api.php(87): ApiMain->execute()
#20 /srv/mediawiki/w/api.php(3): include(string)

Similar to T226969.

Event Timeline

Restricted Application added a project: Discovery-Search. · View Herald TranscriptJul 6 2019, 10:44 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Daimona added a subscriber: Daimona.Jul 7 2019, 2:50 PM

Caused by r513566, $wgCirrusSearchExtraIndexes should be a string[][] and not a string[].

Change 521038 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[operations/mediawiki-config@master] Fix array shape for $wgCirrusSearchExtraIndexes

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

Daimona claimed this task.Jul 7 2019, 2:53 PM

(Please deploy if you wish, I don't know when I may be around for SWAT)

I've added @dcausse to the patch. My schedule is going to be very tight tomorrow so I can't schedule this for SWAT either, nor Cirrus Search is my field either.

Change 521038 merged by jenkins-bot:
[operations/mediawiki-config@master] Fix array shape for $wgCirrusSearchExtraIndexes

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

Mentioned in SAL (#wikimedia-operations) [2019-07-08T11:36:44Z] <urbanecm@deploy1001> Synchronized wmf-config/CirrusSearch-common.php: SWAT: [[:gerrit:521038|Fix array shape for $wgCirrusSearchExtraIndexes]] (T227379) (duration: 00m 51s)

Daimona closed this task as Resolved.Jul 8 2019, 11:48 AM
Daimona removed a project: Patch-For-Review.