Page MenuHomePhabricator

Exception thrown by TermStoreWriterFactory when using API on commons beta cluster
Closed, DuplicatePublic

Description

When I try to query revision data from a page on commons.wikimedia.beta.wmflabs.org using the API I get a LogicException thrown by TermStoreWriterFactory.php [1].

"LogicException at /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/Sql/Terms/TermStoreWriterFactory.php(74)
#0 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/WikibaseRepo.php(1833): Wikibase\\Lib\\Store\\Sql\\Terms\\TermStoreWriterFactory->newItemTermStoreWriter()
#1 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/WikibaseRepo.php(1791): Wikibase\\Repo\\WikibaseRepo->getItemTermStoreWriters()
#2 /srv/mediawiki/php-master/extensions/Wikibase/repo/WikibaseRepo.entitytypes.php(85): Wikibase\\Repo\\WikibaseRepo->newItemHandler()
#3 [internal function]: Wikibase\\Repo\\WikibaseRepo::{closure}()
#4 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Content/EntityContentFactory.php(297): call_user_func(Closure)
#5 /srv/mediawiki/php-master/extensions/Wikibase/repo/RepoHooks.php(135): Wikibase\\Repo\\Content\\EntityContentFactory->getContentHandlerForType(string)
#6 /srv/mediawiki/php-master/vendor/wikimedia/object-factory/src/ObjectFactory.php(172): Wikibase\\RepoHooks::Wikibase\\{closure}(string)
#7 /srv/mediawiki/php-master/vendor/wikimedia/object-factory/src/ObjectFactory.php(102): Wikimedia\\ObjectFactory::getObjectFromSpec(array, array)
#8 /srv/mediawiki/php-master/includes/content/ContentHandlerFactory.php(222): Wikimedia\\ObjectFactory->createObject(Closure, array)
#9 /srv/mediawiki/php-master/includes/content/ContentHandlerFactory.php(170): MediaWiki\\Content\\ContentHandlerFactory->createContentHandlerFromHandlerSpec(string, Closure)
#10 /srv/mediawiki/php-master/includes/content/ContentHandlerFactory.php(82): MediaWiki\\Content\\ContentHandlerFactory->createForModelID(string)
#11 /srv/mediawiki/php-master/includes/content/ContentHandlerFactory.php(140): MediaWiki\\Content\\ContentHandlerFactory->getContentHandler(string)
#12 /srv/mediawiki/php-master/includes/api/ApiQueryRevisionsBase.php(762): MediaWiki\\Content\\ContentHandlerFactory->getAllContentFormats()
#13 /srv/mediawiki/php-master/includes/api/ApiQueryRevisions.php(465): ApiQueryRevisionsBase->getAllowedParams()
#14 /srv/mediawiki/php-master/includes/api/ApiBase.php(1700): ApiQueryRevisions->getAllowedParams(integer)
#15 /srv/mediawiki/php-master/includes/api/ApiBase.php(673): ApiBase->getFinalParams()
#16 /srv/mediawiki/php-master/includes/api/ApiQuery.php(260): ApiBase->extractRequestParams()
#17 /srv/mediawiki/php-master/includes/api/ApiMain.php(1583): ApiQuery->execute()
#18 /srv/mediawiki/php-master/includes/api/ApiMain.php(523): ApiMain->executeAction()
#19 /srv/mediawiki/php-master/includes/api/ApiMain.php(494): ApiMain->executeActionWithErrorHandling()
#20 /srv/mediawiki/php-master/api.php(84): ApiMain->execute()
#21 /srv/mediawiki/w/api.php(3): require(string)
#22 {main}

P.S.: There's no exception thrown on en.wikipedia.beta.wmflabs.org.

[1] https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&format=json&titles=Main%20Page&prop=revisions

Event Timeline

The code throwing the exception:

if ( !in_array( Item::ENTITY_TYPE, $this->localEntitySource->getEntityTypes() ) ) {
    throw new LogicException( 'Local entity source does not have items.' );
}