Page MenuHomePhabricator

Beta cluster: Call to undefined method WikitextContent::getEntity() in /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php on line 189
Closed, ResolvedPublic

Description

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 3 2018, 6:28 PM
thcipriani triaged this task as Unbreak Now! priority.Aug 3 2018, 6:28 PM

UBN since this is affecting folks' ability to use beta

Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptAug 3 2018, 6:28 PM

The error seems to only happen on the main page but not https://en.wikipedia.beta.wmflabs.org/wiki/Special:Preferences (and presumably other pages)

greg added a subscriber: greg.

Marking as blocking the next train just to keep track of this.

I don't think it has to do with the travis changes.

It looks like this one is related: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/442253

greg added subscribers: cscott, Cosine02.

A few more details from a cursory investigation:

  • https://zh.wikipedia.beta.wmflabs.org/ is totally broken
  • the PHP fatal is "Call to undefined method WikitextContent::getEntity()", which isn't a method name in core, nor has includes/content/WikitextContent.php been changed in a meaningful way recently
  • probably a type mismatch. extensions/Wikibase/lib/includes/Store/EntityRevision.php defines 'public function getEntity()', that's my wild guess at what's supposed to be being called
daniel added a comment.EditedAug 5 2018, 5:31 PM

At a quick guess, the new code in WikiPageEntityRevisionLookup does not work correctly for cross-wiki access. It would trigger on any page that accesses a wikidata entity. Seems like I did not test this thoroughly enough. I'll try to get a fix in by tomorrow. If I don't manage that, we'll have to revert https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/442253

daniel added a comment.EditedAug 5 2018, 6:46 PM

Ok, confirmed locally: this is caused by the new WikiPageEntityRevisionLookup code.

Analysis: RevisionStore loads the correct revision content from the correct database (wikidatawiki), but since rev_content_model is NULL in the database, it falls back to using the default content model configured for that namespace locally. For NS_MAIN, that's wikitext on most client wikis. For content loaded from Wikidata, this is of course wrong.

Permanent solution: with the new MCR schema, this problem vanishes, since the content model is always recorded explicitly.

Intermediate solution (draft): defined per-namespace content model overrides in RevisionStore. These can be set by RevisionStoreFactory. But how do they get into RevisionStoreFactory? The only option I see is to introduce a new config setting. Which seems annoying, given the fact that t his will go away anyway.

Change 450476 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/extensions/Wikibase@master] Revert "Use PageUpdater & RevisionStore in Wikibase"

https://gerrit.wikimedia.org/r/450476

Change 450477 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/extensions/Wikibase@master] Warn about unexpected content models when loading entities.

https://gerrit.wikimedia.org/r/450477

Change 450476 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Revert "Use PageUpdater & RevisionStore in Wikibase"

https://gerrit.wikimedia.org/r/450476

With the reverted merged and https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?debug=true looking OK, I guess the priority can be lowered?

Change 450477 abandoned by Daniel Kinzler:
Warn about unexpected content models when loading entities.

Reason:
Redundant per If94f8cb11

https://gerrit.wikimedia.org/r/450477

daniel closed this task as Resolved.Aug 6 2018, 12:28 PM
daniel claimed this task.

Closing, since there is nothing to be done here beyond the revert.

An alternative patch for T194729 is now up at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/450541.

Change 450551 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] Add safeguard against loading content across wikis.

https://gerrit.wikimedia.org/r/450551

Change 450551 merged by jenkins-bot:
[mediawiki/core@master] Add safeguard against loading content across wikis.

https://gerrit.wikimedia.org/r/450551