Last modified: 2013-08-22 14:54:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44825, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42825 - test2.wikipedia can't load wikidata.org's revision content from ES
test2.wikipedia can't load wikidata.org's revision content from ES
Status: VERIFIED FIXED
Product: Wikimedia
Classification: Unclassified
Wikidata (Other open bugs)
wmf-deployment
All All
: Unprioritized major (vote)
: ---
Assigned To: Daniel Kinzler
: ops
Depends on: 42948
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-07 14:33 UTC by Daniel Kinzler
Modified: 2013-08-22 14:54 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel Kinzler 2012-12-07 14:33:09 UTC
test2.wikipedia.org is now configured to act as a client to wikidata.org. In order to show language links defined in the wikidata items, test2 needs to load revision content from wikidata.org's database. This is done in WikiPageEntityLookup::loadEntity(). In the $row parameter, this gets a row that contains fields from wikidata.org's revision table. It then calls Revision::getRevisionText( $row ) to fetch the revision's blob. But it fails for some unknown reason.

Example:

* Request: https://test2.wikipedia.org/wiki/New_York_City?action=purge
* LanguageLinkHandler::getEntityLinks() calls SiteLinkTable::getItemIdForLink(), and gets back the info that q60 is the item to look for.
* it then calls WikiPageEntityLookup::getEntity() to retrieve the entity object.
* WikiPageEntityLookup::getEntity queries wikidata.org's database to get the revision ID for item q60's latest revision.
* it gets rev_id=631469, old_text=DB://cluster25/316188, and old_flags=utf-8,gzip,external
* WikiPageEntityLookup::getEntity calls self::loadEntity() 
* WikiPageEntityLookup::loadEntity calls Revision::getRevisionText on the row with old_text=DB://cluster25/316188, and old_flags=utf-8,gzip,external.
* Revision::getRevisionText returns false.

Chad tried this in eval.php, and it works. So, apparently, somehow fetching the revision blob from ES fails.
Comment 1 Daniel Kinzler 2012-12-10 08:40:17 UTC
Note: the above example applies to the mw1.21-wmf5 branch of the Wikibase modules, as of commit 24d8471add3.
Comment 2 Daniel Kinzler 2012-12-10 10:45:10 UTC
To test for this bug, try the following:

Go to https://test2.wikipedia.org/wiki/Helium, open the edit page. There should be no (or just a few) interlanguage links. 

The, click preview. More (>100) language links should be loaded from https://www.wikidata.org/wiki/Q560. 

Note however that this only works as a test as long as the solution for bug 42187 isn't implemented. That will make it unnecessary to load the item on the client, for now. We *will* need that ability in a few weeks at the latest, though.
Comment 3 Daniel Kinzler 2012-12-10 10:48:30 UTC
In eval.php, try this:

    $row = new stdClass();
    $row->old_text = "DB://cluster25/316188";
    $row->old_flags = "utf-8,gzip,external";
    Revision::getRevisionText( $row );

Apparently, when Chad tried this, it worked. Yet, if tried in a web request, it fails...
Comment 4 Antoine "hashar" Musso (WMF) 2012-12-10 10:59:52 UTC
$ mwscript eval.php --wiki=test2wiki
> var_dump( ExternalStore::fetchFromURL( 'DB://cluster25/316188' ) );
bool(false)
$

:-(
Comment 5 Aaron Schulz 2012-12-10 20:36:41 UTC
As brion remarked on IRC, the external store servers have a DB for each wiki. If you look at addWiki.php you can see how each cluster master has the new DB initialized for a new wiki. Also see storage/blobs.sql. In order to access text blobs saved from a foreign wiki, one would need to change getRevisionText() to pass down some optional wiki ID and change ExternalStore to except it. So if you know you are fetching a text for wikidatawiki that wiki ID could be passed in.

This is a case of some subtle global state (the wiki ID is assumed to be the current wiki ID).
Comment 6 Aaron Schulz 2012-12-10 20:38:07 UTC
(In reply to comment #3)
> In eval.php, try this:
> 
>     $row = new stdClass();
>     $row->old_text = "DB://cluster25/316188";
>     $row->old_flags = "utf-8,gzip,external";
>     Revision::getRevisionText( $row );
> 
> Apparently, when Chad tried this, it worked. Yet, if tried in a web request,
> it
> fails...

Works when run on wikidatawiki, not elsewhere.
Comment 7 Daniel Kinzler 2012-12-11 15:41:05 UTC
fixed by Change I14a7ebb8: (bug 42948) $wiki parameter for getRevisionText().
Comment 8 denny vrandecic 2013-08-22 14:54:08 UTC
Closed older resolved bugs as verified.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links