Page MenuHomeMiraheze

InvalidArgumentException: Setting siteGlobalID is missing from both Repo and Client settings!
Closed, ResolvedPublic

Description

Seeing quite a lot of "InvalidArgumentException: Setting siteGlobalID is missing from both Repo and Client settings!" in the logs.

https://graylog.miraheze.org/messages/graylog_16/1859a2b1-c751-11ee-9f4e-bc2411bdcdc1

Event Timeline

@Paladox can you give us a stacktrace for those without graylog access?

@Paladox can you give us a stacktrace for those without graylog access?

from /srv/mediawiki/1.41/extensions/Wikibase/lib/includes/Modules/SitesModuleBase.php(70)
#0 /srv/mediawiki/1.41/extensions/Wikibase/lib/includes/Modules/CurrentSiteModule.php(89): Wikibase\Lib\Modules\SitesModuleBase->getSetting(string)
#1 /srv/mediawiki/1.41/extensions/Wikibase/lib/includes/Modules/CurrentSiteModule.php(78): Wikibase\Lib\Modules\CurrentSiteModule->makeScript(MediaWiki\ResourceLoader\Context)
#2 /srv/mediawiki/1.41/includes/libs/objectcache/BagOStuff.php(206): Wikibase\Lib\Modules\CurrentSiteModule->Wikibase\Lib\Modules\{closure}(integer)
#3 /srv/mediawiki/1.41/extensions/Wikibase/lib/includes/Modules/CurrentSiteModule.php(74): BagOStuff->getWithSetCallback(string, integer, Closure)
#4 /srv/mediawiki/1.41/includes/ResourceLoader/Module.php(850): Wikibase\Lib\Modules\CurrentSiteModule->getScript(MediaWiki\ResourceLoader\Context)
#5 /srv/mediawiki/1.41/includes/ResourceLoader/Module.php(819): MediaWiki\ResourceLoader\Module->buildContent(MediaWiki\ResourceLoader\Context)
#6 /srv/mediawiki/1.41/includes/ResourceLoader/Module.php(957): MediaWiki\ResourceLoader\Module->getModuleContent(MediaWiki\ResourceLoader\Context)
#7 /srv/mediawiki/1.41/includes/ResourceLoader/StartUpModule.php(237): MediaWiki\ResourceLoader\Module->getVersionHash(MediaWiki\ResourceLoader\Context)
#8 /srv/mediawiki/1.41/includes/ResourceLoader/StartUpModule.php(436): MediaWiki\ResourceLoader\StartUpModule->getModuleRegistrations(MediaWiki\ResourceLoader\Context)
#9 /srv/mediawiki/1.41/includes/ResourceLoader/Module.php(850): MediaWiki\ResourceLoader\StartUpModule->getScript(MediaWiki\ResourceLoader\Context)
#10 /srv/mediawiki/1.41/includes/ResourceLoader/Module.php(819): MediaWiki\ResourceLoader\Module->buildContent(MediaWiki\ResourceLoader\Context)
#11 /srv/mediawiki/1.41/includes/ResourceLoader/Module.php(957): MediaWiki\ResourceLoader\Module->getModuleContent(MediaWiki\ResourceLoader\Context)
#12 /srv/mediawiki/1.41/includes/ResourceLoader/ResourceLoader.php(687): MediaWiki\ResourceLoader\Module->getVersionHash(MediaWiki\ResourceLoader\Context)
#13 /srv/mediawiki/1.41/includes/ResourceLoader/ResourceLoader.php(787): MediaWiki\ResourceLoader\ResourceLoader->getCombinedVersion(MediaWiki\ResourceLoader\Context, array)
#14 /srv/mediawiki/1.41/load.php(53): MediaWiki\ResourceLoader\ResourceLoader->respond(MediaWiki\ResourceLoader\Context)
#15 /srv/mediawiki/1.41/load.php(39): wfLoadMain()
#16 /srv/mediawiki/config/initialise/entrypoints/load.php(3): require(string)
#17 {main}

I have no idea about Wikibase. I'll try my best at finding a solution for this however.

The code:

public function getSetting( string $settingName ) {
	if ( $this->repoSettings->hasSetting( $settingName ) ) {
		return $this->repoSettings->getSetting( $settingName );
	}
	if ( $this->clientSettings->hasSetting( $settingName ) ) {
		return $this->clientSettings->getSetting( $settingName );
	}
	throw new InvalidArgumentException(
		"Setting $settingName is missing from both Repo and Client settings!"
	);
}

Here's what their docs have to say about that config:

This site's global ID (e.g. `'itwiki'`), as used in the sites table.

DEFAULT: [$wgDBname].

So it already seems impossible for that to be missing on a WikibaseClient/WikibaseRepo wiki, if it defaults to the database name.

In fact, this is even hardcoded in our Wikibase config on the client to be the database name of the current wiki (https://github.com/miraheze/mw-config/blob/4ff63e19ca122b9084eb020d6b964e3b7abe676f/Wikibase.php#L65).

Hmmm, their docs only mention this setting on the Client section, it could probably be undefined on a WikibaseRepo wiki, where there is also no WikibaseClient config to query.

The CurrentSiteModule class gets the clientSettings object in the constructor. It is a nullable argument, so it could be getting null on a WikibaseRepo wiki. Client settings are only available on wikis with WikibaseClient installed (https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/0fce91197a0377b0217c1e301b3915db328563af/lib/resources/Resources.php#L31).

TL;DR: I think those exceptions are thrown by wikis with WikibaseRepo where siteGlobalId doesn't have a default value.

Reception123 triaged this task as Normal priority.Feb 13 2024, 06:13
Reception123 edited projects, added Extensions; removed Configuration.
Universal_Omega claimed this task.
Universal_Omega subscribed.

Should be fixed.