Page MenuHomePhabricator

[SUPPORT] Setting $wgServer breaks /runUpdate.sh from wdqs image
Closed, ResolvedPublic

Description

When setting $wgServer in LocalSettings.php, which seems to be mandatory beginning wit the 1.34 images, the /runUpdate.sh in the wdqs-updater container stops working:

wdqs-updater_1 | 13:27:32.419 [main] INFO o.w.q.r.t.change.RecentChangesPoller - Got 1 changes, from Q1@2@20200208132722|2 to Q1@2@20200208132722|2
wdqs-updater_1 | 13:27:32.753 [update 0] WARN org.wikidata.query.rdf.tool.Updater - Contained error syncing. Giving up on Q1
wdqs-updater_1 | org.wikidata.query.rdf.tool.rdf.Munger$BadSubjectException: Unrecognized subjects: [http://internal.domain:8181/wiki/Special:EntityData/Q1, http://internal.domain:8181/entity/Q1]. Expected only sitelinks and subjects starting with http://wikibase.svc/wiki/Special:EntityData/ and [http://wikibase.svc/entity/]
wdqs-updater_1 | at org.wikidata.query.rdf.tool.rdf.Munger$MungeOperation.finishCommon(Munger.java:941)

So the in call

./runUpdate.sh -h http://$WDQS_HOST:$WDQS_PORT -- --wikibaseUrl $WIKIBASE_SCHEME://$WIKIBASE_HOST --conceptUri $WIKIBASE_SCHEME://$WIKIBASE_HOST --entityNamespaces $WDQS_ENTITY_NAMESPACES

--conceptUri $WIKIBASE_SCHEME://$WIKIBASE_HOST has to be changed to probably to a $CONCEPT_URI env variable from the docker-compose.yml file which then corresponds to the value of $wgServer.

I am not sure what to set these values to, when using the setup on localhost, since setting $wgServer to localhost should be avoided.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore renamed this task from Setting $wgServer breaks /runUpdate.sh from wdqs image to [SUPPORT] Setting $wgServer breaks /runUpdate.sh from wdqs image.Feb 17 2020, 7:38 AM
Addshore claimed this task.
Addshore added a project: Wikidata-Campsite.

This is due to one of the Wikibase defaults being created from wgServer.
Changing wgServer will cause this default to change:

	'conceptBaseUri' => function() {
		$uri = preg_replace( '!^//!', 'http://', $GLOBALS['wgServer'] );
		return $uri . '/entity/';
	},

Changing your conceptbaseUri will require a reload of the query service.
See https://addshore.com/2019/11/changing-the-concept-uri-of-an-existing-wikibase-with-data/

Alternatively you can just set the conceptBaseUri itself rather than using the default which uses wgServer.