Page MenuHomePhabricator

PHP Warning: "array_keys() expects parameter 1 to be array" from WikibaseMediaInfo in ApiOpenSearch
Open, Needs TriagePublic

Description

Error

MediaWiki version: 1.35.0-wmf.4

message
[{exception_id}] {exception_url}   ErrorException from line 98 of /srv/mediawiki/php-1.35.0-wmf.4/extensions/WikibaseMediaInfo/src/Services/MediaInfoPrefetchingTermLookup.php: PHP Warning: array_keys() expects parameter 1 to be array, boolean given
exception.trace
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /extensions/WikibaseMediaInfo/src/Services/MediaInfoPrefetchingTermLookup.php(98): array_keys(boolean)
#2 /extensions/Wikibase/data-access/src/ByTypeDispatchingPrefetchingTermLookup.php(53): Wikibase\MediaInfo\Services\MediaInfoPrefetchingTermLookup->prefetchTerms(array, array, array)
#3 /extensions/Wikibase/data-access/src/ByTypeDispatchingPrefetchingTermLookup.php(53): Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup->prefetchTerms(array, array, array)
#4 /extensions/Wikibase/data-access/src/ByTypeDispatchingPrefetchingTermLookup.php(53): Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup->prefetchTerms(array, array, array)
#5 /extensions/Wikibase/data-access/src/ByTypeDispatchingPrefetchingTermLookup.php(89): Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup->prefetchTerms(array, array, array)
#6 /extensions/Wikibase/lib/includes/Store/EntityTermLookupBase.php(52): Wikibase\DataAccess\ByTypeDispatchingPrefetchingTermLookup->getTermsOfType(Wikibase\MediaInfo\DataModel\MediaInfoId, string, array)
#7 /extensions/Wikibase/lib/includes/Store/LanguageFallbackLabelDescriptionLookup.php(47): Wikibase\Lib\Store\EntityTermLookupBase->getLabels(Wikibase\MediaInfo\DataModel\MediaInfoId, array)
#8 /extensions/WikibaseCirrusSearch/src/Hooks.php(348): Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookup->getLabel(Wikibase\MediaInfo\DataModel\MediaInfoId)
#9 /extensions/WikibaseCirrusSearch/src/Hooks.php(369): Wikibase\Search\Elastic\Hooks::amendSearchResults(Wikibase\Repo\WikibaseRepo, LanguageEn, array)
#10 /includes/Hooks.php(174): Wikibase\Search\Elastic\Hooks::onApiOpenSearchSuggest(array)
#11 /includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#12 /includes/api/ApiOpenSearch.php(95): Hooks::run(string, array)
#13 /includes/api/ApiMain.php(1603): ApiOpenSearch->execute()
#14 /includes/api/ApiMain.php(539): ApiMain->executeAction()
#15 /includes/api/ApiMain.php(510): ApiMain->executeActionWithErrorHandling()
#16 /api.php(83): ApiMain->execute()
#17 /srv/mediawiki/w/api.php(3): require(string)
#18 {main}

Impact

Unclear.

Notes

This appears in wmf.3 and was happening before today's rollout of wmf.4 to group1:

brennen@mwlog1001:/srv/mw-log$ grep MediaInfoPrefetchingTermLookup ./error.log | grep -c wmf.4                                                                                                                                                                                 
156
brennen@mwlog1001:/srv/mw-log$ grep MediaInfoPrefetchingTermLookup ./error.log | grep -c wmf.3
588
brennen@mwlog1001:/srv/mw-log$ grep MediaInfoPrefetchingTermLookup ./error.log | grep  wmf.3 | head
2019-10-30 08:15:38 ...

Details

Request ID
XbnirgpAAE0AAEjAcc8AAAAW
Request URL
/w/api.php?action=opensearch&format=json&formatversion=2&search=m8&namespace=0%7C6%7C12%7C14%7C100%7C106&limit=10&suggest=true
Related Gerrit Patches:
mediawiki/extensions/WikibaseMediaInfo : masterSkip entities already known not to exist

Event Timeline

brennen created this task.Oct 30 2019, 7:56 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 30 2019, 7:56 PM
brennen updated the task description. (Show Details)Oct 30 2019, 8:44 PM
Krinkle renamed this task from PHP Warning: array_keys() expects parameter 1 to be array, boolean given to PHP Warning: "array_keys() expects parameter 1 to be array" from WikibaseMediaInfo in ApiOpenSearch.Thu, Nov 7, 8:47 PM
Krinkle updated the task description. (Show Details)
Krinkle edited Stack Trace. (Show Details)
Krinkle added subscribers: egardner, Krinkle.

@egardner Is WikibaseMediaInfo actively triaged? If not, consider automatically tagging with Structured Data Engineering through a Herald rule. Max Binder, Andre or myself can help if needed :)

@Krinkle WikibaseMediaInfo is not being actively monitored as far as I am aware; I'll bring this ticket (as well as the question about the best way to handle issues like these) to the attention of the rest of the team.

Change 549819 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@master] Skip entities already known not to exist

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

Change 549819 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Skip entities already known not to exist

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