Page MenuHomePhabricator

link to wikidata data object missing
Closed, ResolvedPublic

Description

With the recent vagrant and wikibase updates the problem of the links between links between the wikis of a wikifarm created by vagrant was fixed.
However, there in the wiki referred as main wiki hereafter (database wiki, wikiname devwiki) there is no link to the wikidata item that would point to the wikidata-wiki.
For example for the wikibase item Q5
http://wikidata-drmf2016.wmflabs.org/wiki/Q5
there are links to
http://en-drmf2016.wmflabs.org/wiki/Main_Page
and
https://drmf2016.wmflabs.org/wiki/Formula:AL.CC.cn.01

There is also a link back from
http://en-drmf2016.wmflabs.org/wiki/Main_Page
to the wikidata item labelled "Wikidata Datenobjekt",
but there is no such link on
https://drmf2016.wmflabs.org/wiki/Formula:AL.CC.cn.01

It would be nice to get some help how to investigate the problem further.
Feel free to log into the drmf2016.math.eqiad.wmflabs instance.

Event Timeline

I also tried to rebuild everything on the wikidata wiki... but that failed

vagrant@mediawiki-vagrant:/vagrant/mediawiki/maintenance$ mwscript rebuildall.php --wiki=wikidatawiki
** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):
Dropping index...
Clearing searchindex table...Done
Rebuilding index fields for 28 pages...
Failed to deserialize content of revision 1 of page `Main_Page`!

Rebuild the index...
Done.


** Rebuilding recentchanges table:
Loading from page and revision tables...
$wgRCMaxAge=7776000 (90 days)
Updating links and size differences...
Loading from user, page, and logging tables...
Flagging bot account edits...
Flagging auto-patrolled edits...
Removing duplicate revision and logging entries...
Deleting feed timestamps.
Done.


** Rebuilding links tables -- this can take a long time. It should be safe to abort via ctrl+C if you get bored.
Refreshing redirects table.
Starting from page_id 1 of 28.
[e3db5b1a7aa5297cefa3be82] [no req]   MWContentSerializationException from line 218 of /vagrant/mediawiki/extensions/WikidataBuildResources/extensions/Wikibase/lib/includes/store/EntityContentDataCodec.php: Failed to decode as application/json
Backtrace:
#0 /vagrant/mediawiki/extensions/WikidataBuildResources/extensions/Wikibase/lib/includes/store/EntityContentDataCodec.php(276): Wikibase\Lib\Store\EntityContentDataCodec->decodeEntityContentData(string, string)
#1 /vagrant/mediawiki/extensions/WikidataBuildResources/extensions/Wikibase/repo/includes/Content/EntityHandler.php(400): Wikibase\Lib\Store\EntityContentDataCodec->decodeRedirect(string, string)
#2 /vagrant/mediawiki/includes/Revision.php(1086): Wikibase\Repo\Content\EntityHandler->unserializeContent(string, string)
#3 /vagrant/mediawiki/includes/Revision.php(1034): Revision->getContentInternal()
#4 /vagrant/mediawiki/includes/page/WikiPage.php(663): Revision->getContent(integer, NULL)
#5 /vagrant/mediawiki/maintenance/refreshLinks.php(202): WikiPage->getContent(integer)
#6 /vagrant/mediawiki/maintenance/refreshLinks.php(157): RefreshLinks->fixRedirect(integer)
#7 /vagrant/mediawiki/maintenance/refreshLinks.php(58): RefreshLinks->doRefreshLinks(NULL, boolean, NULL, boolean, boolean)
#8 /vagrant/mediawiki/maintenance/rebuildall.php(60): RefreshLinks->execute()
#9 /vagrant/mediawiki/maintenance/doMaintenance.php(103): RebuildAll->execute()
#10 /vagrant/mediawiki/maintenance/rebuildall.php(67): require_once(string)
#11 /var/www/w/MWScript.php(95): require_once(string)
#12 {main}

Moreover there is a error in the js console when trying to add an interwiki link from the main wiki (unfortunately in German)

Quellübergreifende (Cross-Origin) Anfrage blockiert: Die Gleiche-Quelle-Regel verbietet das Lesen der externen Ressource auf https://wikidata-drmf2016.wmflabs.org/w/api.php?action=query&format=json&origin=https%3A%2F%2Fdrmf2016%2Ewmflabs%2Eorg&meta=userinfo. (Grund: CORS-Kopfzeile 'Access-Control-Allow-Origin' fehlt). <unbekannt>

I could fix the problem with the rebuild by deleting the page with id 1 manually from the database

delete from page where page_id =1;

Moreover there is a error in the js console when trying to add an interwiki link from the main wiki (unfortunately in German)

Quellübergreifende (Cross-Origin) Anfrage blockiert: Die Gleiche-Quelle-Regel verbietet das Lesen der externen Ressource auf https://wikidata-drmf2016.wmflabs.org/w/api.php?action=query&format=json&origin=https%3A%2F%2Fdrmf2016%2Ewmflabs%2Eorg&meta=userinfo. (Grund: CORS-Kopfzeile 'Access-Control-Allow-Origin' fehlt). <unbekannt>

Fortunately this can be worked around with the firefox extension
https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/

The exception during rebuildall is perhaps caused by the mainpage being in the main namespace which now has content model wikibase-item and expects a json structure. This can atm only be fixed by disabling Wikibase, moving or deleting the main page and enabling the extension again.

The cross origin issue can somehow be fixed by changing the headers. I don't know if there is a nice way to do that in the vagrant role though.

However, that shouldn't be the cause of the missing link to your repository wiki. A few strange things are happening: There are no sitelinks shown on the main wiki and only a broken sitelink on the enwiki. Perhaps there are some broken entries in your sites table in the database. What does that table currently contain?

I think it would be far less confusing if I could reduce the number of wikis from three to two.
The site table looks like that

+---------+-----------------+-----------+------------+-------------+---------------+---------------+--------------------------------+--------------------------------------------------------------------
| site_id | site_global_key | site_type | site_group | site_source | site_language | site_protocol | site_domain                    | site_data                                                          
+---------+-----------------+-----------+------------+-------------+---------------+---------------+--------------------------------+--------------------------------------------------------------------
|       1 | enwiki          | mediawiki | wikipedia  | local       | de            | http          | gro.sbalfmw.6102fmrd-ne.       | a:1:{s:5:"paths";a:2:{s:9:"file_path";s:35:"http://en-drmf2016.wmfl
|       3 | wiki            | mediawiki | wikipedia  | local       | en            | http          | gro.sbalfmw.6102fmrd.          | a:1:{s:5:"paths";a:2:{s:9:"file_path";s:32:"http://drmf2016.wmflabs
|       4 | wikidatawiki    | mediawiki | wikidata   | local       | en            | http          | gro.sbalfmw.6102fmrd-atadikiw. | a:1:{s:5:"paths";a:2:{s:9:"file_path";s:41:"http://wikidata-drmf201
+---------+-----------------+-----------+------------+-------------+---------------+---------------+--------------------------------+--------------------------------------------------------------------

I played around with that table a little bit to see the effects. I do not uderstand why enwiki works well but the wiki does not work as expected.

I have created a subtask for the javascript issue.
However, I'm still having problems to create the links. Sometimes it works; sometimes it does not work.

Physikerwelt triaged this task as High priority.

Works with the latest versions.