Page MenuHomePhabricator

Find out how to deploy MediaInfo without breaking Commons
Closed, ResolvedPublic

Description

The first attempt to deploy the WikibaseMediaInfo extension failed due to T211237: wbgetentities has stopped returning content on Beta Cluster Commons. The cause for this is still unclear.

One hypothesis was that federation support is still incomplete, see T204748: Create Federated Wikibase instance on Beta Commons. Specifically, the hypothesis was that the WikibaseClient configuration (which has the empty ID prefix refer to Wikidata) conflicts with the WikibaseRepo configuration (which has the empty ID prefix refer to Commons). This however turned out to be untrue: WikibaseClient and WikibaseRepo currently do not share state or configuration. This is conceptually problematic and may lead to issues at some point (see T211800), but for now it means that inconsistent WikibaseClient and WikibaseRepo configurations can in fact co-exist: It's possible to run MediaInfo on a wiki that at the same time acceses another Wikibase repo (like Wikidata) from Wikidata, with a configuration like that on the beta cluster (confirmed locally by Daniel).

This ticket is intended to track the investigation and resolution of any issues that block the deployment of MediaInfo on a fedarated Wikibase environment as targeted by the SDC project.

Event Timeline

daniel created this task.Dec 12 2018, 5:45 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 12 2018, 5:45 PM
Ramsey-WMF added a subscriber: Ramsey-WMF.

Looking at T204748#4783220 and poking at the code, it seems that the problem is that the entityNamespace setting for MediaInfo is missing. However, this should be impossible, since that setting is forced by the onWikibaseRepoEntityNamespaces hook.

So perhaps the problem is in the initialization order. The hook is registered via the extension registration mechanism; if something triggers initialization of the Wikibase EntityNamespaceLookup service before that hook has been registered and execute, the EntityNamespaceLookup will have incomplete configurations, which will result in failure.

This could be addressed by setting the entity namespace explicitly in the configuration, instead of relying it being set automatically by the hook. That should fix the immediate problem, but does not resolve the underlying issue: MediaInfo is brittle against the order of initialization. I will investigate whether this can be resolved by using a service modifier to register the namespace, instead of a hook that augments the configuration.

Change 479417 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/extensions/WikibaseMediaInfo@master] Fail hard if no entity namespace is configured for MediaInfo.

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

Change 479419 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/extensions/Wikibase@master] Fail hard if an entity namespace is not configured.

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

Change 479425 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/extensions/Wikibase@master] [DNM] Log constructor params of EntityNamespaceLookup.

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

As it turns out, I missed to crucial line of configuration when replicating the setup locally:

$wgWBRepoSettings['foreignRepositories'] = $wmgWikibaseForeignRepositories;

With $wmgWikibaseForeignRepositories defining values for the empty prefix (the "" key), this would override the configuration WikibaseRepo would define for itself. Changing $wmgWikibaseForeignRepositories so that is uses the "wikidata" key instead of the "" key resolves the issue.

daniel closed this task as Resolved.Dec 13 2018, 6:04 PM
daniel claimed this task.

Change 479425 abandoned by Daniel Kinzler:
[DNM] Log constructor params of EntityNamespaceLookup.

Reason:
found it

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

Change 479417 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Fail hard if no entity namespace is configured for MediaInfo.

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

Change 479419 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Fail hard if an entity namespace is not configured.

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

greg added a project: Multimedia.Mar 7 2019, 10:59 PM