Jump to content

Extension talk:Wikibase Client

About this board

How set up Wikibase client to another DB server

1
31.44.94.162 (talkcontribs)

I have my own installation of wikidata. I want to connect it to my wiki. But in the configs I see only direct access to the database on the server of the main wiki - repoDatabase. How can I specify a different DB server?

$wgWBClientSettings['entitySources'] = [ 'local' => [ 'entityNamespaces' => [ 'item' => 0, 'property' => 120, 'lexeme' => 146, ], 'repoDatabase' => "wikidata", //'repoDatabase' => false, 'baseUri' => 'my-dat/entity/', 'rdfNodeNamespacePrefix' => 'wd', 'rdfPredicateNamespacePrefix' => , 'interwikiPrefix' => 'd', ], ];

Reply to "How set up Wikibase client to another DB server"

Get error "Failed to access name from content_models using id = 2" in Wikibase Client extension

4
Summary by Beginneruser

Ops Problem solved I debug error and try for resolve this content_models table in database of Wikibase repo site requirement backup

Beginneruser (talkcontribs)

Hi

For Change siteGlobalID from es to eswiki, me empty wbc_entity_usage table

and change $wgWBClientSettings['siteGlobalID'] = 'es'; to $wgWBClientSettings['siteGlobalID'] = 'eswiki'; in LocalSettings.php file

But get following error in MW 1.35.5

[bb68aeddeebdcdff167b271c] /wiki/Main_Page Wikibase\DataModel\Services\Lookup\EntityLookupException from line 51 of /path/w/extensions/Wikibase/lib/includes/Store/RevisionBasedEntityLookup.php: Failed to access name from content_models using id = 2

Backtrace:

#0 /path/w/vendor/wikibase/data-model-services/src/Lookup/RedirectResolvingEntityLookup.php(51): Wikibase\Lib\Store\RevisionBasedEntityLookup->getEntity()
#1 /path/w/extensions/Wikibase/client/includes/Hooks/SiteLinksForDisplayLookup.php(96): Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup->getEntity()
#2 /path/w/extensions/Wikibase/client/includes/Hooks/SiteLinksForDisplayLookup.php(82): Wikibase\Client\Hooks\SiteLinksForDisplayLookup->getSiteLinksForItemId()
#3 /path/w/extensions/Wikibase/client/includes/Hooks/LangLinkHandler.php(269): Wikibase\Client\Hooks\SiteLinksForDisplayLookup->getSiteLinksForPageTitle()
#4 /path/w/extensions/Wikibase/client/includes/Hooks/LangLinkHandler.php(290): Wikibase\Client\Hooks\LangLinkHandler->getEffectiveRepoLinks()
#5 /path/w/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandler.php(98): Wikibase\Client\Hooks\LangLinkHandler->addLinksFromRepository()
#6 /path/w/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandler.php(80): Wikibase\Client\Hooks\ParserOutputUpdateHookHandler->doContentAlterParserOutput()
#7 /path/w/includes/HookContainer/HookContainer.php(155): Wikibase\Client\Hooks\ParserOutputUpdateHookHandler->onContentAlterParserOutput()
#8 /path/w/includes/HookContainer/HookRunner.php(1242): MediaWiki\HookContainer\HookContainer->run()
#9 /path/w/includes/content/AbstractContent.php(594): MediaWiki\HookContainer\HookRunner->onContentAlterParserOutput()
#10 /path/w/includes/Revision/RenderedRevision.php(263): AbstractContent->getParserOutput()
#11 /path/w/includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()
#12 /path/w/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()
#13 /path/w/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()
#14 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()
#15 /path/w/includes/Revision/RenderedRevision.php(197): call_user_func()
#16 /path/w/includes/poolcounter/PoolWorkArticleView.php(216): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#17 /path/w/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleView->doWork()
#18 /path/w/includes/page/Article.php(810): PoolCounterWork->execute()
#19 /path/w/includes/actions/ViewAction.php(80): Article->view()
#20 /path/w/includes/MediaWiki.php(532): ViewAction->show()
#21 /path/w/includes/MediaWiki.php(313): MediaWiki->performAction()
#22 /path/w/includes/MediaWiki.php(945): MediaWiki->performRequest()
#23 /path/w/includes/MediaWiki.php(548): MediaWiki->main()
#24 /path/w/index.php(54): MediaWiki->run()
#25 /path/w/index.php(47): wfIndexMain()
#26 {main}

in other language wiki (frwiki and enwiki) not problem but only on this language wiki (eswiki) get error !!!

Please help me !!

Beginneruser (talkcontribs)

I have to reset all Wikibase repo entry

So run sudo php populateEntityUsage.php in extensions/Wikibase/client/maintenance

I want get new Entity for eswiki siteGlobalID in wbc_entity_usage table

but after run query get old Entity of es siteGlobalID in wbc_entity_usage table

Beginneruser (talkcontribs)
Beginneruser (talkcontribs)

Ops Problem solved I debug error and try for resolve this content_models table in database of Wikibase repo site requirement backup

Wikibase Client installation

9
77.56.48.49 (talkcontribs)

I installed wikibase lib and client Configured as follows $wgWBSettings['repoUrl'] = '//www.wikidata.org'; $wgWBSettings['repoScriptPath'] = '/mediawiki'; $wgWBSettings['repoArticlePath'] = '/mediawiki/$1'; $wgWBSettings['siteGlobalID'] = 'mywiki'; $wgWBSettings['repoDatabase'] = 'mwikidb'; $wgWBSettings['changesDatabase'] = 'mywikidb';

I tried to get a property from repoUrl with: {{#property:q260}} but nothing happen .

Some hints how to configure or use wikidata in mywiki ?

Regards g

Katie Filbert (WMDE) (talkcontribs)

Do you have Wikibase Repo enabled somewhere? Wikibase Client cannot access wikidata.org, except for within wikimedia servers where the wikidata clients (e.g. wikipedia) are able to access the wikidata database directly. If you have your own Wikibase Repo instance, then update repoUrl and double check the repoDatabase setting (e.g. do you really intend it to be different from changesDatabase?). Cheers.

77.56.48.49 (talkcontribs)

I was thinking it should be possible to have the client only as reader, to access the wikidata data. FYI: I defined my own Wikibase Repo and it was working, but this was not the original goal,

Thanks g

Lydia Pintscher (WMDE) (talkcontribs)

A third-party client like you want to do it is not possible yet.

Jeroen De Dauw (talkcontribs)

It should not be far off... Maybe we ought to provide a list of things not working yet. This is all I can think off, and those are just guesses as I'm not up to speed with client state:

  • No change propagation system usable by non-WMF available yet, would need custom coding/setup from third party side at present
  • Not able to write back to repo due to cross domain request policies messing with API requests (this one I'm really not sure about)

Anything else?

Emijrp (talkcontribs)

Is it possible now? Or not yet? I would like to access to Wikidata data from an external wiki. Is there any workaround? Thanks.

Lydia Pintscher (WMDE) (talkcontribs)

It's not possible yet and to be honest there are a ton of more important things we need to do before we get to this  :/

Tosfos (talkcontribs)

It's been a while. Is this possible yet?

Jmkim dot com (talkcontribs)

Is it possible now? Or not yet?

Reply to "Wikibase Client installation"

WDQS-UPDATER_1 keeps failing/restarting with exit code 1

2
Tinyttt (talkcontribs)

Running Wikibase based on the docker-compose.yml file on wikibase-docker repository. 7 of 8 containers are up except for the the WDQS-updater which keeps restarting with the following error.

Tinyttt (talkcontribs)

The following is from the logs:

at org.wikidata.query.rdf.tool.change.ChangeSourceContext.getStartTime(ChangeSourceContext.java:97)

at org.wikidata.query.rdf.tool.Update.initialize(Update.java:144)

at org.wikidata.query.rdf.tool.Update.main(Update.java:97)

wait-for-it.sh: waiting 300 seconds for wikibase.svc:80

wait-for-it.sh: wikibase.svc:80 is available after 0 seconds

wait-for-it.sh: waiting 300 seconds for wdqs.svc:9999

wait-for-it.sh: wdqs.sv

c:9999

is available after 0 seconds

Updating via http://wdqs.svc:9999/bigdata/namespace/wdq/sparql

OpenJDK 64-Bit Server VM warning: Cannot open file /var/log/wdqs/wdqs-updater_jvm_gc.pid10.log due to No such file or directory

#logback.classic pattern: %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n

04:13:17.250 [main] INFO org.wikidata.query.rdf.tool.Update - Starting Updater 0.3.10-SNAPSHOT (8bba8bfb0bbb12361c0e214fe482fbe15fcaa129)

04:13:18.251 [main] INFO o.w.q.r.t.change.ChangeSourceContext - Checking where we left off

04:13:18.252 [main] INFO o.w.query.rdf.tool.rdf.RdfRepository - Checking for left off time from the updater

04:13:18.512 [main] INFO o.w.query.rdf.tool.rdf.RdfRepository - Found left off time from the updater

04:13:18.514 [main] ERROR org.wikidata.query.rdf.tool.Update - Error during initialization.

java.lang.IllegalStateException: RDF store reports the last update time is before the minimum safe poll time. You will have to reload from scratch or you might have missing data.

at org.wikidata.query.rdf.tool.change.ChangeSourceContext.getStartTime(ChangeSourceContext.java:97)

at org.wikidata.query.rdf.tool.Update.initialize(Update.java:144)

at org.wikidata.query.rdf.tool.Update.main(Update.java:97)

Exception in thread "main" java.lang.IllegalStateException: RDF store reports the last update time is before the minimum safe poll time. You will have to reload from scratch or you might have missing data.

at org.wikidata.query.rdf.tool.change.ChangeSourceContext.getStartTime(ChangeSourceContext.java:97)

at org.wikidata.query.rdf.tool.Update.initialize(Update.java:144)

at org.wikidata.query.rdf.tool.Update.main(Update.java:97)

wait-for-it.sh: waiting 300 seconds for wikibase.svc:80

wait-for-it.sh: wikibase.svc:80 is available after 0 seconds

wait-for-it.sh: waiting 300 seconds for wdqs.svc:9999

wait-for-it.sh: wdqs.svc:9999 is available after 0 seconds

Updating via http://wdqs.svc:9999/bigdata/namespace/wdq/sparql

OpenJDK 64-Bit Server VM warning: Cannot open file /var/log/wdqs/wdqs-updater_jvm_gc.pid10.log due to No such file or directory

#logback.classic pattern: %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n

04:14:19.547 [main] INFO org.wikidata.query.rdf.tool.Update - Starting Updater 0.3.10-SNAPSHOT (8bba8bfb0bbb12361c0e214fe482fbe15fcaa129)

04:14:24.297 [main] INFO o.w.q.r.t.change.ChangeSourceContext - Checking where we left off

04:14:24.297 [main] INFO o.w.query.rdf.tool.rdf.RdfRepository - Checking for left off time from the updater

04:14:24.602 [main] INFO o.w.query.rdf.tool.rdf.RdfRepository - Found left off time from the updater

04:14:24.604 [main] ERROR org.wikidata.query.rdf.tool.Update - Error during initialization.

java.lang.IllegalStateException: RDF store reports the last update time is before the minimum safe poll time. You will have to reload from scratch or you might have missing data.

at org.wikidata.query.rdf.tool.change.ChangeSourceContext.getStartTime(ChangeSourceContext.java:97)

at org.wikidata.query.rdf.tool.Update.initialize(Update.java:144)

at org.wikidata.query.rdf.tool.Update.main(Update.java:97)

Exception in thread "main" java.lang.IllegalStateException: RDF store reports the last update time is before the minimum safe poll time. You will have to reload from scratch or you might have missing data.

at org.wikidata.query.rdf.tool.change.ChangeSourceContext.getStartTime(ChangeSourceContext.java:97)

at org.wikidata.query.rdf.tool.Update.initialize(Update.java:144)

at org.wikidata.query.rdf.tool.Update.main(Update.java:97)

Reply to "WDQS-UPDATER_1 keeps failing/restarting with exit code 1"

Usage with WikibaseMediaInfo ("Structured Data")

5
176.36.227.144 (talkcontribs)
176.36.227.144 (talkcontribs)

(note: I invoked that template in the context of Ukrainian Wikipedia)

Tacsipacsi (talkcontribs)

Lua access is different from API access. Lua access is currently only possible within Commons.

176.36.227.144 (talkcontribs)

@Tacsipacsi That's sad, but I suspect there has to be plans to add Lua support (smth like WikibaseMediaInfoClient extension). Maybe you are aware of such phabricator issue or have a roadmap link (I'd subscribe to their updates)?

Also, is there any other way to query some data (not just structured data) about Commons media files from a Wikipedia module?

Tacsipacsi (talkcontribs)

I tried to find something about the cross-wiki support (I’m pretty sure I once read that there’s no cross-wiki support yet), but I didn’t succeed.

Some very basic information (dimensions, MIME type etc.) can be queried about any (Commons or local) file using the title library.

Reply to "Usage with WikibaseMediaInfo ("Structured Data")"

Cannot access the database after upgrade to MediaWiki 1.31.0

11
Till Kraemer (talkcontribs)

Hi, I just upgraded to MediaWiki 1.31.0. My repo works fine, however, when I try to load an article on the client wiki, I get the following error:

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Cannot access the database)

Backtrace:

#0 /path/to/mywikis/pool/w/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1134): Wikimedia\Rdbms\Database->reportConnectionError('Unknown databas...')
#1 /path/to/mywikis/pool/w/includes/libs/rdbms/loadbalancer/LoadBalancer.php(749): Wikimedia\Rdbms\LoadBalancer->reportConnectionError()
#2 /path/to/mywikis/pool/w/includes/dao/DBAccessBase.php(64): Wikimedia\Rdbms\LoadBalancer->getConnection(0, Array, 'repo')
#3 /path/to/mywikis/pool/w/extensions/Wikibase/lib/includes/Store/Sql/SiteLinkTable.php(221): DBAccessBase->getConnection(-1)
#4 /path/to/mywikis/pool/w/extensions/Wikibase/lib/includes/Store/CachingSiteLinkLookup.php(147): Wikibase\Lib\Store\Sql\SiteLinkTable->getItemIdForLink('poolwiki', 'Main Page')
#5 /path/to/mywikis/pool/w/extensions/Wikibase/lib/includes/Store/CachingSiteLinkLookup.php(75): Wikibase\Lib\Store\CachingSiteLinkLookup->getAndCacheItemIdForLink('poolwiki', 'Main Page')
#6 /path/to/mywikis/pool/w/extensions/Wikibase/client/includes/LangLinkHandler.php(101): Wikibase\Lib\Store\CachingSiteLinkLookup->getItemIdForLink('poolwiki', 'Main Page')
#7 /path/to/mywikis/pool/w/extensions/Wikibase/client/includes/LangLinkHandler.php(331): Wikibase\Client\LangLinkHandler->getEntityLinks(Object(Title))
#8 /path/to/mywikis/pool/w/extensions/Wikibase/client/includes/LangLinkHandler.php(352): Wikibase\Client\LangLinkHandler->getEffectiveRepoLinks(Object(Title), Object(ParserOutput))
#9 /path/to/mywikis/pool/w/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandlers.php(97): Wikibase\Client\LangLinkHandler->addLinksFromRepository(Object(Title), Object(ParserOutput))
#10 /path/to/mywikis/pool/w/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandlers.php(65): Wikibase\Client\Hooks\ParserOutputUpdateHookHandlers->doContentAlterParserOutput(Object(Title), Object(ParserOutput))
#11 /path/to/mywikis/pool/w/includes/Hooks.php(177): Wikibase\Client\Hooks\ParserOutputUpdateHookHandlers::onContentAlterParserOutput(Object(WikitextContent), Object(Title), Object(ParserOutput))
#12 /path/to/mywikis/pool/w/includes/Hooks.php(205): Hooks::callHook('ContentAlterPar...', Array, Array, NULL)
#13 /path/to/mywikis/pool/w/includes/content/AbstractContent.php(520): Hooks::run('ContentAlterPar...', Array)
#14 /path/to/mywikis/pool/w/includes/poolcounter/PoolWorkArticleView.php(144): AbstractContent->getParserOutput(Object(Title), 7803, Object(ParserOptions))
#15 /path/to/mywikis/pool/w/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork()
#16 /path/to/mywikis/pool/w/includes/page/Article.php(604): PoolCounterWork->execute()
#17 /path/to/mywikis/pool/w/includes/actions/ViewAction.php(68): Article->view()
#18 /path/to/mywikis/pool/w/includes/MediaWiki.php(500): ViewAction->show()
#19 /path/to/mywikis/pool/w/includes/MediaWiki.php(294): MediaWiki->performAction(Object(Article), Object(Title))
#20 /path/to/mywikis/pool/w/includes/MediaWiki.php(861): MediaWiki->performRequest()
#21 /path/to/mywikis/pool/w/includes/MediaWiki.php(524): MediaWiki->main()
#22 /path/to/mywikis/pool/w/index.php(42): MediaWiki->run()
#23 {main}

The local database can be accessed perfectly, special pages like recent changes or user contributions show up properly, but somehow the repo database can't be accessed anymore :/

Any ideas are more than appreciated! Thanks and cheers!

Thiemo Kreuz (WMDE) (talkcontribs)

Did you made sure to run the update.php maintenance script on both the repo and the client database?

Till Kraemer (talkcontribs)

Hi @Thiemo Kreuz (WMDE), thanks for your reply! Yeah, I ran the update script and I just did it again, just to make sure. Same error :/ With older MediaWiki versions I used the Wikidata extension bundle, but it seems to be discontinued. This time, I installed Wikibase using Composer as suggested.

I just noticed that Wikipedia uses WikimediaBadges and WikibaseLexeme, so I wanted to install them too, just in case. Wasn't able to install WikibaseLexeme on the client wiki though. Showed me a blank page.

The LocalSettings.php on the client wiki looks like this:

# Wikibase Extension
$wgEnableWikibaseRepo = false;
$wgEnableWikibaseClient = true;
#$wmgUseWikibaseRepo = false;
#$wmgUseWikibaseClient = true;
#require_once __DIR__ . "/extensions/Wikidata/Wikidata.php";
#require_once __DIR__ . "/extensions/Wikidata/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
#require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
#require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";

# Settings
$wgWBClientSettings['repoUrl'] = 'https://data.mywiki.com';
$wgWBClientSettings['repoScriptPath'] = '/w';
$wgWBClientSettings['repoArticlePath'] = '/wiki/$1';
$wgWBClientSettings['siteGlobalID'] = 'enwiki';
$wgWBClientSettings['repoDatabase'] = 'datawiki';
$wgWBClientSettings['changesDatabase'] = 'datawiki';
#$wgWBClientSettings['siteLinkGroups'] = 'mywiki';
$wgWBClientSettings['repoSiteId'] = 'datawiki';
$wgWBClientSettings['repoSiteName'] = 'MyWiki';
$wgWBClientSettings['siteLinkGroup'] = 'mywiki';

# Optional
#$wgWBClientSettings['repoNamespaces'] = array(
#	'wikibase-item' => 'Item', //leave empty if items are in the main namespace
#	'wikibase-property' => 'Property'
#);
$wgWBClientSettings['siteGroup'] = 'mywiki'; //you probably don't need this one, but do if your siteGroup is different from 'wikipedia'

# WikimediaBadges Extension
wfLoadExtension( 'WikimediaBadges' );

# WikibaseLexeme Extension
#wfLoadExtension( 'WikibaseLexeme' );

I also noticed that on Wikidata the client is also activated. Did that for my repo too, left $wgEnableWikibaseClient = false; untouched though.

The LocalSettings.php on the repo looks like this:

# Wikibase Extension
$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = false;
#$wmgUseWikibaseRepo = true;
#$wmgUseWikibaseClient = false;
#require_once __DIR__ . "/extensions/Wikidata/Wikidata.php";
#require_once __DIR__ . "/extensions/Wikidata/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";

$baseNs = 100;

// Define the namespace indexes
define( 'WB_NS_PROPERTY', $baseNs + 2 );
define( 'WB_NS_PROPERTY_TALK', $baseNs + 3 );
 
// Define the namespaces
$wgExtraNamespaces[WB_NS_PROPERTY] = 'Property';
$wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'Property_talk';
 
// Assigning the correct content models to the namespaces
#$wgWBRepoSettings['entityNamespaces'][CONTENT_MODEL_WIKIBASE_ITEM] = NS_MAIN; 
$wgWBRepoSettings['entityNamespaces']['item'] = NS_MAIN;

#$wgWBRepoSettings['entityNamespaces'][CONTENT_MODEL_WIKIBASE_PROPERTY] = WB_NS_PROPERTY;
$wgWBRepoSettings['entityNamespaces']['property'] = WB_NS_PROPERTY;

define( 'WB_NS_QUERY', $baseNs + 4 );
define( 'WB_NS_QUERY_TALK', $baseNs + 5 );
 
$wgExtraNamespaces[WB_NS_QUERY] = 'Query';
$wgExtraNamespaces[WB_NS_QUERY_TALK] = 'Query_talk';
 
#$wgWBRepoSettings['entityNamespaces']['CONTENT_MODEL_WIKIBASE_QUERY'] = WB_NS_QUERY;
$wgWBRepoSettings['entityNamespaces'][CONTENT_MODEL_WIKIBASE_QUERY] = WB_NS_QUERY;

$wgWBRepoSettings['changesDatabase'] = 'datawiki';
$wgWBRepoSettings['conceptBaseUri'] = 'https://data.mywiki.com/wiki/';

$wgWBRepoSettings['localClientDatabases'] = array( 'bgwiki', 'bnwiki', 'cswiki', 'dewiki', 'enwiki', 'eswiki', 'frwiki', 'huwiki', 'hywiki', 'itwiki', 'kawiki', 'nlwiki', 'plwiki', 'poolwiki', 'ptwiki', 'pt_brwiki', 'ruwiki', 'srwiki', 'svwiki', 'trwiki' );

# WikimediaBadges Extension
wfLoadExtension( 'WikimediaBadges' );

# WikibaseLexeme Extension
wfLoadExtension( 'WikibaseLexeme' );

I don't really know what to do right now :/ Any help is more than welcome. Thanks and cheers!

Thiemo Kreuz (WMDE) (talkcontribs)
  • Please check if the MediaWiki and Wikibase versions you are using match.
  • WikimediaBadges and WikibaseLexeme are optional. If you are not sure, you probably don't need them.
  • The client's configuration format changed. Even if there is backwards-compatibility code in place, it might have failed for you for some reason. What you can try is to add the new format $wgWBClientSettings['repositories'] = …; either in addition or replacing the old $wgWBClientSettings['repoDatabase']. See WikibaseClient.example.php for an example.
Till Kraemer (talkcontribs)

Hi @Thiemo Kreuz (WMDE), thanks for your suggestions!

I just checked the versions again. I'm running MediaWiki 1.31.0 on the clients and on the repo and the Wikibase version file looks like this:

Wikibase: REL1_31
2018-04-17T22:37:46
8178d16

I added $wgWBClientSettings['repositories'] = 'datawiki'; to LocalSettings.php, but when I run the update script, the following error appears:

[abc123567] [no req]   TypeError from line 117 of /path/to/mywikis/en/w/extensions/Wikibase/lib/includes/WikibaseSettings.php: Argument 1 passed to Wikibase\WikibaseSettings::getEntityNamespacesFromRepositorySettings() must be of the type array, string given, called in /path/to/mywikis/en/w/extensions/Wikibase/lib/includes/WikibaseSettings.php on line 111
Backtrace:
#0 /path/to/mywikis/en/w/extensions/Wikibase/lib/includes/WikibaseSettings.php(111): Wikibase\WikibaseSettings::getEntityNamespacesFromRepositorySettings(string)
#1 /path/to/mywikis/en/w/extensions/Wikibase/lib/includes/WikibaseSettings.php(69): Wikibase\WikibaseSettings::buildEntityNamespaceConfigurations(Wikibase\SettingsArray)
#2 /path/to/mywikis/en/w/extensions/Wikibase/client/includes/Hooks/EchoSetupHookHandlers.php(43): Wikibase\WikibaseSettings::getClientSettings()
#3 /path/to/mywikis/en/w/extensions/Wikibase/client/includes/Hooks/EchoSetupHookHandlers.php(65): Wikibase\Client\Hooks\EchoSetupHookHandlers::newFromGlobalState()
#4 /path/to/mywikis/en/w/includes/Hooks.php(177): Wikibase\Client\Hooks\EchoSetupHookHandlers::onBeforeCreateEchoEvent(array, array, array)
#5 /path/to/mywikis/en/w/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#6 /path/to/mywikis/en/w/extensions/Echo/includes/EchoHooks.php(48): Hooks::run(string, array)
#7 /path/to/mywikis/en/w/includes/Setup.php(940): EchoHooks::initEchoExtension()
#8 /path/to/mywikis/en/w/maintenance/doMaintenance.php(81): require_once(string)
#9 /path/to/mywikis/en/w/maintenance/update.php(245): require_once(string)
#10 {main}

This also happens when I remove $wgWBClientSettings['repoDatabase'] = 'datawiki';. I'm running PHP 7.0.8. Should I upgrade to 7.0.28?

Thanks and cheers!

Thiemo Kreuz (WMDE) (talkcontribs)

The repositories setting is an array, as shown in the example. The empty array key '' might look confusing. This identifies the default repository, which is what you need. All you need to do is to fill in the values for repoDatabase and baseUri, I believe.

Till Kraemer (talkcontribs)

Hi @Thiemo Kreuz (WMDE), thanks for your help!

For some reason, just adding repoDatabase and baseUri doesn't work for me. If I add this to LocalSettings.php...

$wgWBClientSettings['repositories'] = [
			'repoDatabase' => 'datawiki',
			'baseUri' => 'https://data.mywiki.com/entity',
	];

...I get the following error:

[abc1234567] [no req]   TypeError from line 120 of /path/to/mywikis/en/w/extensions/Wikibase/lib/includes/WikibaseSettings.php: Argument 2 passed to Wikibase\WikibaseSettings::Wikibase\{closure}() must be of the type array, string given
Backtrace:
#0 [internal function]: Wikibase\WikibaseSettings::Wikibase\{closure}(array, string)
#1 /path/to/mywikis/en/w/extensions/Wikibase/lib/includes/WikibaseSettings.php(123): array_reduce(array, Closure, array)
#2 /path/to/mywikis/en/w/extensions/Wikibase/lib/includes/WikibaseSettings.php(111): Wikibase\WikibaseSettings::getEntityNamespacesFromRepositorySettings(array)
#3 /path/to/mywikis/en/w/extensions/Wikibase/lib/includes/WikibaseSettings.php(69): Wikibase\WikibaseSettings::buildEntityNamespaceConfigurations(Wikibase\SettingsArray)
#4 /path/to/mywikis/en/w/extensions/Wikibase/client/includes/Hooks/EchoSetupHookHandlers.php(43): Wikibase\WikibaseSettings::getClientSettings()
#5 /path/to/mywikis/en/w/extensions/Wikibase/client/includes/Hooks/EchoSetupHookHandlers.php(65): Wikibase\Client\Hooks\EchoSetupHookHandlers::newFromGlobalState()
#6 /path/to/mywikis/en/w/includes/Hooks.php(177): Wikibase\Client\Hooks\EchoSetupHookHandlers::onBeforeCreateEchoEvent(array, array, array)
#7 /path/to/mywikis/en/w/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#8 /path/to/mywikis/en/w/extensions/Echo/includes/EchoHooks.php(48): Hooks::run(string, array)
#9 /path/to/mywikis/en/w/includes/Setup.php(940): EchoHooks::initEchoExtension()
#10 /path/to/mywikis/en/w/maintenance/doMaintenance.php(81): require_once(string)
#11 /path/to/mywikis/en/w/maintenance/update.php(245): require_once(string)
#12 {main}

So I added the whole block:

$wgWBClientSettings['repositories'] = [
		'' => [
			'repoDatabase' => 'datawiki',
			'baseUri' => 'https://data.mywiki.com/entity',
			'entityNamespaces' => [
				'item' => WB_REPO_NS_ITEM,
				'property' => WB_REPO_NS_PROPERTY
			],
			'prefixMapping' => [ '' => '' ],
		]
	];

I was now able to run the update script successfully and the item ID links (like https://data.mywiki.com/wiki/Special:EntityPage/Q1234567) show up on the client wiki. However, the interwiki links don't appear on the client wiki and I have the following error in my log file:

PHP Warning:  Wikibase\Client\LangLinkHandler::getEntityLinks: Could not load item Q1234567 for XYZ [Called from Wiki
base\Client\LangLinkHandler::getEntityLinks in /path/to/mywikis/en/w/extensions/Wikibase/client/includes/LangLinkHandler.php at line 116] in /path/to/mywikis/en/w/includes/debug/MWDebug.php on line 309
PHP message: PHP Warning:  According to a SiteLinkLookup Q1234567 is linked to enwiki while it is not or it does not exist. [Called from Wikibase\Client\ParserOutput\ClientParserOutputDataUpdater::setBadgesProperty in /path/to/mywikis/en/w/extensions/Wikibase/client/includes/ParserOutput/ClientParserOutputDa
taUpdater.php at line 139] in /path/to/mywikis/en/w/includes/debug/MWDebug.php on line 309" while reading response header from upstream, client: 1.2.3.4, server: en.mywiki.com, request: "GET /wiki/XYZ HTTP/1.1
", upstream: "fastcgi://1.2.3.4:1234", host: "en.mywiki.com", referrer: "https://en.mywiki.com/wiki/XYZ"

Not sure what I'm missing here :/

Thanks and cheers!

Thiemo Kreuz (WMDE) (talkcontribs)

Oh, I have never seen this message before. It sounds like a secondary database table got out of sync. I'm afraid I need to hand over to the core Wikidata team. Maybe Leszek can help?

PS: I just realized your item namespace is NS_MAIN, not WB_REPO_NS_ITEM. You need to fix this in the configuration you just added.

Till Kraemer (talkcontribs)

Hi @Thiemo Kreuz (WMDE), I changed WB_REPO_NS_ITEM to NS_MAIN in LocalSettings.php as you suggested and woohoo, it works perfectly now! :) Thank you so much for your help! I'm soo happy now! :) Long live Wikibase and Thiemo Kreuz! :)

Cheers!

2601:144:4100:A372:20A1:4DF9:D7DC:A349 (talkcontribs)

I wonder I can run mediaWiki 1.32 without database replication?

Alex Lai

Thiemo Kreuz (WMDE) (talkcontribs)

Hey Alex. Is this question related to Wikibase? If not, I'm afraid this is the wrong page to ask. I'm also not sure if we are talking about the same when we say "database replication". What is the exact issue you run into?

Reply to "Cannot access the database after upgrade to MediaWiki 1.31.0"
Paucabot (talkcontribs)

Can someone explain me why the title of a wiki page is not automatically used for the label of the item when a wikipedia page is added in that language from the wikipedia? It is this way by default if you create an item, but not if you only add a link to a wikipedia page. Why is that behaviour of this Wikibase Client?

Thanks in advance.

Reply to "Automatic labels"

Extension not working on tr.wiktionary

2
HastaLaVi2 (talkcontribs)

On this module, there is a line "local URL = mw.wikibase.getEntityUrl(wikidataItem)", but it won't work the way it should like its english wiktionary version. When I remove "mw.wikibase" from if condition it says "wikibase is a nil value", why is that?

Lydia Pintscher (WMDE) (talkcontribs)

All Wiktionaries except English don't yet have arbitrary access enabled. You can file a ticket on phabricator.wikimedia.org to get it enabled.

Reply to "Extension not working on tr.wiktionary"

Need help with installing to Mediawiki 1.31

5
Zzmonty (talkcontribs)

Can somebody please post what exactly you put into your LocalSettings.php for a client only install of this extension to access wikidata.org? Thanks.

Thiemo Kreuz (WMDE) (talkcontribs)
Zzmonty (talkcontribs)

Tried that and nothing works. I also looked at the advanced installation, and tried to copy those items and it did not work. If you got this to work with a 1.31 mediawiki, and the client only part of this extension, if you could just look at your LocalSettings.php file and just copy everything that you have in that file related to this extension it would be much appreciated. Maybe another extension I have installed is conflicting with this extension. i don't know. I just know that i followed the instructions a couple of times, and I could not get this extension to even load.

The only other item is that I don't have composure, so I was trying to manually install the extension. Did I miss some dependency either with a third party application or else another extension?

Thiemo Kreuz (WMDE) (talkcontribs)

Please describe what "did not work" means. What error message do you get on which page in which namespace?

Having the libraries Wikibase depends on installed via Composer is a must. I'm not aware of a way to do this "manually".

Zzmonty (talkcontribs)

Then that is where the problem is, because I did not use composer.

Reply to "Need help with installing to Mediawiki 1.31"

Template displaying {{#statements:Pxxx}}

3
OlePedia (talkcontribs)
Lydia Pintscher (WMDE) (talkcontribs)

At this point Wikibase requires more up-to-date code than MediaWiki 1.28.2. Have you tried installing the latest code from git?

OlePedia (talkcontribs)

Lydia,

I have now tried ver. 1.29.0 and 1.30.0-alpha (from Git) with the same result.

Reply to "Template displaying {{#statements:Pxxx}}"