Page MenuHomePhabricator

Math Extension: Class 'Wikibase\Client\WikibaseClient' not found on wikimania2016.wikimedia.org
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.35.0-wmf.10

message
Class 'Wikibase\Client\WikibaseClient' not found

Impact

Started with wmf.10, about 0.75 errors/hour

Notes

Details

Request ID
XfD9EApAIDMAAFB@GGoAAADD
Request URL
https://wikimania2016.wikimedia.org/w/api.php
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.10/extensions/Math/src/ApiMathWikibaseExtracts.php(24): MathWikibaseConfig::getDefaultMathWikibaseConfig()
#1 /srv/mediawiki/php-1.35.0-wmf.10/vendor/wikimedia/object-factory/src/ObjectFactory.php(184): ApiMathWikibaseExtracts->__construct(ApiQuery, string)
#2 /srv/mediawiki/php-1.35.0-wmf.10/vendor/wikimedia/object-factory/src/ObjectFactory.php(102): Wikimedia\ObjectFactory::getObjectFromSpec(array, array)
#3 /srv/mediawiki/php-1.35.0-wmf.10/includes/api/ApiModuleManager.php(183): Wikimedia\ObjectFactory->createObject(array, array)
#4 /srv/mediawiki/php-1.35.0-wmf.10/includes/api/ApiModuleManager.php(155): ApiModuleManager->instantiateModule(string, array)
#5 /srv/mediawiki/php-1.35.0-wmf.10/includes/api/ApiBase.php(622): ApiModuleManager->getModule(string)
#6 /srv/mediawiki/php-1.35.0-wmf.10/includes/api/ApiBase.php(2418): ApiBase->getModuleFromPath(string)
#7 /srv/mediawiki/php-1.35.0-wmf.10/includes/api/ApiParamInfo.php(310): ApiBase->getFinalParamDescription()
#8 /srv/mediawiki/php-1.35.0-wmf.10/includes/api/ApiParamInfo.php(130): ApiParamInfo->getModuleInfo(ApiQuery)
#9 /srv/mediawiki/php-1.35.0-wmf.10/includes/api/ApiMain.php(1603): ApiParamInfo->execute()
#10 /srv/mediawiki/php-1.35.0-wmf.10/includes/api/ApiMain.php(539): ApiMain->executeAction()
#11 /srv/mediawiki/php-1.35.0-wmf.10/includes/api/ApiMain.php(510): ApiMain->executeActionWithErrorHandling()
#12 /srv/mediawiki/php-1.35.0-wmf.10/api.php(78): ApiMain->execute()
#13 /srv/mediawiki/w/api.php(3): require(string)
#14 {main}

Event Timeline

Michael created this task.Dec 11 2019, 2:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 11 2019, 2:48 PM

Seems to be slightly related to the work that has gone on in T208758

ApiMathWikibaseExtracts

Always does this:

		$this->wikibase = new MathWikibaseConnector(
			MathWikibaseConfig::getDefaultMathWikibaseConfig()
		);

It shouldn't do that when client is not loaded and this API module should have a nice fallback / not register the api module in this situation.

Addshore triaged this task as Medium priority.Dec 11 2019, 3:13 PM
Addshore moved this task from incoming to monitoring on the Wikidata board.

@Andreg-p do you know how to fix that? If you need more information please use this ticket. Also consider discussing it together with T229939, where we also depend on input from Wikidata experts.

@Andreg-p just reported that might be caused by the API endpoint. This endpoint is currently not used by the popups extensions. And maybe we should convert it to the new REST API as suggested by @Tgr in https://phabricator.wikimedia.org/T239357#5698243.
@Pchelolo do you know of one can conditionally expose endpoints, or should we just return a 404 if Wikibase is unavailable?

(This bumped up when we deployed wmf.10 to group1 and not just group0, BTW.)

@Andreg-p do you know how to fix that? If you need more information please use this ticket. Also consider discussing it together with T229939, where we also depend on input from Wikidata experts.

As said in T240458#5732270 the math extension uses or tries to use the WikibaseClient class, event when the wikibase client is not enabled.
Math needs to check if if is running on a wiki with WikibaseClient before trying to use it.
Math should have a fallback for this API is client does not exist, or not register the api module at all.

Change 556700 had a related patch set uploaded (by AndreG-P; owner: AndreG-P):
[mediawiki/extensions/Math@master] Delete Math Wikibase API

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

Math should have a fallback for this API is client does not exist, or not register the api module at all.

That seems the most reasonable thing to do. In a follow up, we can follow the approach I described above.

@Andreg-p just reported that might be caused by the API endpoint. This endpoint is currently not used by the popups extensions. And maybe we should convert it to the new REST API as suggested by @Tgr in https://phabricator.wikimedia.org/T239357#5698243.
@Pchelolo do you know of one can conditionally expose endpoints, or should we just return a 404 if Wikibase is unavailable?

Change 556700 merged by jenkins-bot:
[mediawiki/extensions/Math@master] Delete Math Wikibase API

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

Physikerwelt closed this task as Resolved.Dec 28 2019, 10:20 AM

The entire endpoint was removed from https://wikimania2016.wikimedia.org/w/api.php