Page MenuHomePhabricator

Impossible to establish site links
Closed, ResolvedPublic

Description

At the moment it seems impossible to create site links from an item to either Wikipedia or even the Mediawiki that comes with the docker image.

It would be good to have documentation about how to set this up or have it as an option in the docker-compose file.

Event Timeline

despens created this task.Oct 1 2018, 8:11 PM
Restricted Application added a project: Wikidata. · View Herald TranscriptOct 1 2018, 8:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Screencap of how this looks:

I can reproduce this behavior in the Docker Compose image but I don't have an issue in Vagrant with creating links to production Wikipedia.

dbs added a subscriber: dbs.Nov 19 2018, 11:27 PM

Can you tell what's inside sites table in these installation? If it's empty, that's the reason and they need to be populated using php lib/maintenance/populateSitesTable.php (According to this page). If the table is not empty, we have a bigger problem. Still we should handle this somehow. I'm not fan of docker-compose making changes to the database.

dbs added a comment.Nov 27 2018, 11:00 PM

I can confirm that the sites table is empty in the stock Docker image, and that running /var/www/html/extensions/Wikibase/lib/maintenance/populateSitesTable.php populates the Wikipedia links boxes for the items I had imported from Wikidata.

Maybe that's something to be documented - to be run at intervals if Wikibase users want to establish links from items to Wikipedia?

Is there any hint, how I can manually populate site table with the active wiki, probably with ./maintenance/addSite.php?

I think it is necessary, that elasticsearch is running. If so, you can use php maintenance/eval.php in the wikibase/wikibase container with the following code:

$sites = [];
$langCode = 'en';
$site = new MediaWikiSite();
$site->setGlobalId( 'clientwiki' );
$site->setGroup( 'wikipedia' );
$site->setLanguageCode( $langCode );
$site->addInterwikiId( $langCode );
$site->addNavigationId( $langCode );
$site->setPath( MediaWikiSite::PATH_PAGE, "http://localhost:8181/wiki/$1" );
$site->setPath( MediaWikiSite::PATH_FILE, "http://wikibase.svc/w/$1" );
$sites[] = $site;
$sitesTable = SiteSQLStore::newInstance();
$sitesTable->clear();
$sitesTable->saveSites( $sites );

Setting the sitelinks should be possible then.

I think it is necessary, that elasticsearch is running. If so, you can use php maintenance/eval.php in the wikibase/wikibase container with the following code:

This should not require elasticsearch..?
What makes you think it does? It sounds like that might be the bug?

This should not require elasticsearch..?
What makes you think it does? It sounds like that might be the bug?

Yes, you're right, my fault. I've just switched off elasticsearch and it still works.

Testing it before, without elasticsearch properly installed, always got "page not found in wiki". But obviously that had other reasons.

For convenience we could probably add a maintenance script that does the above steps?
Does anyone here want to give it a shot? :)

Tarrow added a subscriber: Tarrow.Mar 14 2019, 11:42 AM
Addshore closed this task as Resolved.Jun 22 2019, 10:42 PM
Addshore claimed this task.

this was recently re documented.

Please see T218282#5129954

Restricted Application added a project: User-Addshore. · View Herald TranscriptJun 22 2019, 10:42 PM