Page MenuHomePhabricator

beta: Setup a Wikidata wiki
Closed, ResolvedPublic

Description

Wikidata has been deployed on production for quite a while now but beta still does not have a Wikidata wiki. We need to create a new one, possibly under the name wikidata.beta.wmflabs.org .


Version: unspecified
Severity: enhancement

Details

Reference
bz47827

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:20 AM
bzimport set Reference to bz47827.

Related URL: https://gerrit.wikimedia.org/r/61428 (Gerrit Change I7ae71e3b1a2a3115c4e704134b0e3c4130d71876)

I got a basic setup at http://wikidata.beta.wmflabs.org/

That emits a stack trace though:

failed to deserialize

Backtrace:

#0 /data/project/apache/common-local/php-master/extensions/Wikibase/lib/includes/EntityFactory.php(141): Wikibase\EntityFactory->unserializedData('==This subdomai...', 'application/jso...')
#1 /data/project/apache/common-local/php-master/extensions/Wikibase/repo/includes/content/ItemHandler.php(69): Wikibase\EntityFactory->newFromBlob('item', '==This subdomai...', 'application/jso...')
#2 /data/project/apache/common-local/php-master/includes/Revision.php(1010): Wikibase\ItemHandler->unserializeContent('==This subdomai...', 'application/jso...')
#3 /data/project/apache/common-local/php-master/includes/Revision.php(951): Revision->getContentInternal()
#4 /data/project/apache/common-local/php-master/includes/WikiPage.php(634): Revision->getContent(1, NULL)
#5 /data/project/apache/common-local/php-master/includes/WikiPage.php(464): WikiPage->getContent()
#6 [internal function]: WikiPage->isRedirect()
#7 /data/project/apache/common-local/php-master/includes/Article.php(1961): call_user_func_array(Array, Array)
#8 /data/project/apache/common-local/php-master/includes/Wiki.php(374): Article->__call('isRedirect', Array)
#9 /data/project/apache/common-local/php-master/includes/Wiki.php(374): Article->isRedirect()
#10 /data/project/apache/common-local/php-master/includes/Wiki.php(295): MediaWiki->initializeArticle()
#11 /data/project/apache/common-local/php-master/includes/Wiki.php(565): MediaWiki->performRequest()
#12 /data/project/apache/common-local/php-master/includes/Wiki.php(458): MediaWiki->main()
#13 /data/project/apache/common-local/php-master/index.php(55): MediaWiki->run()
#14 /data/project/apache/common-local/w/index.php(3): require('/data/project/a...')
#15 {main}

I have disabled the WikibaseRepo extension on beta wikidata ( https://gerrit.wikimedia.org/r/65838 ). That at least let us show the main page now.

I have imported the production Wikidata:Main_page as well as MediaWiki:common.css then changed the wiki main page to be Wikidata:Main_page. Enabled WikibaseRepo again https://gerrit.wikimedia.org/r/65839

The main page no more produce a stack trace.

http://wikidata.beta.wmflabs.org/wiki/Wikidata:Main_Page

I have ZERO idea how to create new items to test out whether it works properly.

I have sent an announcement on wikitech-l and qa lists.

you did the right thing :) The default main page is wikitext and we set the main namespace to be entity content.

The entity content handler chokes on wikitext content. The other thing to do would be temporarily disable wikibase and delete the page. Then re-enable Wikibase.

We will need to have the populateSitesTable maintenance script run via puppet, in order to add items.

On beta I ran:

$ mwscript extensions/Wikibase/lib/maintenance/populateSitesTable.php --wiki=wikidatawiki
done.
$

The maintenance script is hardcoded for production:

$wiki = $this->getOption( 'load-from', 'https://meta.wikimedia.org/w/api.php' );

Need to pass a different --load-from :D

The api URL should be http://deployment.wikimedia.beta.wmflabs.org/w/api.php . Due to labs instance running behind a NAT, they can not access the FQDN (bug 45868). On deployment-bastion I have setup a hack to rewrite the IP packet to points directly to the instance cache:

root@deployment-bastion:~# iptables -t nat -I OUTPUT --dest 208.80.153.219 -j DNAT --to-dest 10.4.0.17

Then reran the command with the proper URL:

$ mwscript extensions/Wikibase/lib/maintenance/populateSitesTable.php --wiki=wikidatawiki --load-from=http://deployment.wikimedia.beta.wmflabs.org/w/api.php
done.
$

Following a discussion with Aude on IRC, I truncated the wikidatawiki tables sites and sites_identifiers which were containing production information then reran the populateSitesTable.php script.

Result:

(mw@deployment-sql02) [wikidatawiki]> select * from site_identifiers;
+---------+------------+---------------+

si_sitesi_typesi_key

+---------+------------+---------------+

1equivalentaa
1interwikiaa
2equivalentde
2interwikide
3equivalentdewikivoyage
3interwikidewikivoyage
4equivalenten
4interwikien
5equivalentenwiktionary
5interwikienwiktionary
6equivalentenwikibooks
6interwikienwikibooks
7equivalentenwikinews
7interwikienwikinews
8equivalentenwikiquote
8interwikienwikiquote
9equivalentenwikisource
9interwikienwikisource
10equivalentenwikiversity
10interwikienwikiversity
11equivalentenwikivoyage
11interwikienwikivoyage
12equivalenteo
12interwikieo
13equivalenthe
13interwikihe
14equivalentsimple
14interwikisimple
15equivalentsq
15interwikisq

+---------+------------+---------------+
30 rows in set (0.00 sec)

(mw@deployment-sql02) [wikidatawiki]> select site_global_key, REVERSE(site_domain) from sites;
+-----------------+------------------------------------+

site_global_keyREVERSE(site_domain)

+-----------------+------------------------------------+

aawiki.aa.wikipedia.beta.wmflabs.org
dewiki.de.wikipedia.beta.wmflabs.org
dewikivoyage.de.wikivoyage.beta.wmflabs.org
enwiki.en.wikipedia.beta.wmflabs.org
enwiktionary.en.wiktionary.beta.wmflabs.org
enwikibooks.en.wikibooks.beta.wmflabs.org
enwikinews.en.wikinews.beta.wmflabs.org
enwikiquote.en.wikiquote.beta.wmflabs.org
enwikisource.en.wikisource.beta.wmflabs.org
enwikiversity.en.wikiversity.beta.wmflabs.org
enwikivoyage.en.wikivoyage.beta.wmflabs.org
eowiki.eo.wikipedia.beta.wmflabs.org
hewiki.he.wikipedia.beta.wmflabs.org
simplewiki.simple.wikipedia.beta.wmflabs.org
sqwiki.sq.wikipedia.beta.wmflabs.org

+-----------------+------------------------------------+
15 rows in set (0.00 sec)

(mw@deployment-sql02) [wikidatawiki]>

So I guess it is running fine now.

Using:

Sites::singleton()->getSites( false );

that does show up the beta.* links :-)