Page MenuHomePhabricator

PHP error in update.php for MediaWiki + WikiBase version 1.38.2
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Downloaded/extracted MediaWiki 1.38.2
  • Copied over LocalSettings.php and composer.local.json and a few images
  • Downloaded Wikibase with git clone -b REL1_38 https://github.com/wikimedia/mediawiki-extensions-Wikibase.git Wikibase
  • Ran git submodule update --init --recursive and composer update for Wikibase extension
  • Downloaded WikibaseImport from https://github.com/filbertkm/WikibaseImport.git
  • Downloaded other extensions we are using (Elastica, OAuth, CirrusSearch) all from REL1_38, Ran composer update for each
  • Reset owner/group to apache user for entire installation
  • For MediaWiki, ran composer update --no-dev (and also composer install to be safe)
  • Ran cd maintenance && php update.php

What happens?:

[root@myhostname www]# cd mediawiki-1.38.2/
[root@myhostname mediawiki-1.38.2]# cd maintenance/
[root@myhostname maintenance]# sudo -u apache php update.php
PHP Fatal error:  Wikibase\DataModel\Entity\SerializableEntityId cannot implement Wikibase\DataModel\Entity\EntityId - it is not an interface in /var/www/mediawiki-1.38.2/extensions/Wikibase/lib/packages/wikibase/data-model/src/Entity/SerializableEntityId.php on line 11

What should have happened instead?:
Update script should have run normally.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • Server is Red Hat Enterprise Linux release 8.6 (Ootpa)

I know that there's probably something simple here, but I can't put my finger on it.

Event Timeline

Hi @Cajunjoel

note that Wikibase's REL1_xx branches are created in automated manner on arbitrary points in time that are related to Mediawiki's release process. There is only limited testing of the Wikibase code on that branch actually fully works with a relevant Mediawiki version.
WMDE reviews REL1_xx branches, ensures they're fully functional and adjusts the code on the branches when necessary as part of publishing Wikibase Suite releases. (also in tar.gz format) That said we are a little behind and will only get to MW 1.38 compatible Wikibase version in a few weeks.

It is a bit of guesswork on my side but if i had to guess I'd speculate that some software component might have installed outdated version of 'wikibase/data-model' library. It is now shipped with wikibsae extension code, not installed from packagist like prior to 2021. Might be that some other extension in your stack still composer installs some older version from packagist that has a varying signature of EntityId. At a quick look, it might for instance be WikibaseImport: https://github.com/filbertkm/WikibaseImport/blob/c0b2f955367337eb9453bf6cb32a06a5c3160ccd/composer.json#L18

Cajunjoel claimed this task.

Thank you, Leszek. You are correct about WikibaseImport being the source of the trouble. I deleted it and and disabled it from LocalSettings.php and the update completed successfully. It hasn't been updated in years.

Threfore, the rule is: If update.php is failing, disable all extensions and re-enable them one-by-one to find the source.