Page MenuHomePhabricator

Wikidata role on vagrant not working locally (unclear why)
Open, Needs TriagePublic

Description

On vagrant I got the following error when trying to install wikibase:

On the wikidata page:

MediaWiki internal error.

Original exception: [5d98d62860f7a9ca3425d9b6] /wiki/Main_Page InvalidArgumentException from line 54 of /vagrant/mediawiki/extensions/WikibaseQualityConstraints/vendor/data-values/serialization/src/Deserializers/DataValueDeserializer.php: $builders must map data types to callables or class names. 'DataValues\Geo\Values\GlobeCoordinateValue' is not a DataValue class.

At the client wiki:

( ! ) Fatal error: Uncaught Error: Class 'Wikibase\DataModel\Entity\ItemId' not found in /vagrant/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php on line 35
( ! ) Error: Class 'Wikibase\DataModel\Entity\ItemId' not found in /vagrant/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php on line 35

Signs point to unmet dependencies but I still have the error after doing manual composer installs in all the required extensions.

Event Timeline

Mvolz created this task.Nov 1 2018, 2:42 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 1 2018, 2:42 PM

However composer automatically updated this. I have checked the composer.lock file and it says

"require-dev": {

"data-values/geo": "~3.0",

Hmm, that's not right, thats looking at the require-dev you need to look at the require field.
Could you post your whole composer.lock somewhere as well as what version of Wikibase your running?

AFAIK Wikibase does not use Geo 4.x, since Geo 4.x requires PHP 7.1. So it is not clear to me how the 4.1 release could affect Wikibase.

It is also not clear this issue is related to "GlobeCoordinateValue no longer extends DataValueObject". The code in the serialization thing throwing the exception checks for the interface, which is still implemented, see https://github.com/DataValues/Serialization/blob/master/src/Deserializers/DataValueDeserializer.php#L52-L63

As to "GlobeCoordinateValue no longer extends DataValueObject" technically being a breaking change, this is true. However since I am not aware of any users relying on that, especially users already on 4.x, I choose to not do a more costly (for the consumers) major release.

As @Addshore said, that composer info does not look right. You'll get the error you are getting when the code is not loaded. So my guess is that you do not have it loaded.

Mvolz added a comment.Nov 1 2018, 2:55 PM

As @Addshore said, that composer info does not look right. You'll get the error you are getting when the code is not loaded. So my guess is that you do not have it loaded.

Okay thanks, I'll look into it later.

Mvolz renamed this task from Latest release of DataValues/Geo is incompatible with deserialiser so it breaks WikibaseQualityConstraints install (and entire wikidata role in vagrant) to Wikidata role on vagrant not working locally (unclear why).Nov 1 2018, 2:56 PM
Mvolz added a comment.EditedNov 4 2018, 3:28 PM

I've done a completely fresh install (new clone and everything) and I'm producing the same issue with the wikidata role. On the client page it's the same as T197868 and T201615

( ! ) Fatal error: Uncaught Error: Class 'Wikibase\DataModel\Entity\ItemId' not found in /vagrant/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php on line 35
( ! ) Error: Class 'Wikibase\DataModel\Entity\ItemId' not found in /vagrant/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php on line 35

As @Addshore said, that composer info does not look right. You'll get the error you are getting when the code is not loaded. So my guess is that you do not have it loaded.

I think that's correct.

When I do a manual composer install from WikibaseQualityConstraints, it installs lots of things. But this still doesn't fix the bug unfortunately.

My composer.lock does not include the data-values/geo library in the require, only in the require-dev, which is ~3.0. The composer.json does not point to any particular data-value/geo version. I guess this is getting pulled in as a dependency of "wikibase/data-model-serialization": "^2.0.0", which in composer.lock is 2.8.0, and that's what's present in the composer.lock, but geo isn't actually getting installed.

Here's is my composer.lock: https://phabricator.wikimedia.org/P7760. So yeah, correct that ~3 isn't installed, that's just what's included in composer.lock from having installed data-model-serialization.

I'm sort of at a loss of what to next; clearly geo is not getting installed but I can't find anything that says it *should* be since it's not in any of the composer.json files except as a dev dependency.

(Definitely there are some libraries missing, even though I've done vagrant git-update. On the wikidata page, it's still

MediaWiki internal error.

Original exception: [1d92f6c895e9a708e3b01e41] /wiki/Main_Page InvalidArgumentException from line 54 of /vagrant/mediawiki/extensions/WikibaseQualityConstraints/vendor/data-values/serialization/src/Deserializers/DataValueDeserializer.php: $builders must map data types to callables or class names. 'DataValues\Geo\Values\GlobeCoordinateValue' is not a DataValue class.

AFAIK Wikibase does not use Geo 4.x, since Geo 4.x requires PHP 7.1. So it is not clear to me how the 4.1 release could affect Wikibase.

It is also not clear this issue is related to "GlobeCoordinateValue no longer extends DataValueObject". The code in the serialization thing throwing the exception checks for the interface, which is still implemented, see https://github.com/DataValues/Serialization/blob/master/src/Deserializers/DataValueDeserializer.php#L52-L63

As to "GlobeCoordinateValue no longer extends DataValueObject" technically being a breaking change, this is true. However since I am not aware of any users relying on that, especially users already on 4.x, I choose to not do a more costly (for the consumers) major release.

The most recent release of mediawiki is apparently not compatible with php5, support was dropped.

https://www.mediawiki.org/wiki/Compatibility#PHP

I'm running HEAD for everything, incl wikibase (this is what vagrant does by default) and using 7.

Here's is my composer.lock: https://phabricator.wikimedia.org/P7760. So yeah, correct that ~3 isn't installed, that's just what's included in composer.lock from having installed data-model-serialization.

So that is the composer.lock for WikibaseQualityConstraints, which isn't the composer.lock we want as that won't be loaded.

The only autoloader for composer that is loaded will be the mediawiki autoloader in the mediawiki vendor dir.
So we need to have a look at the composer.lock in the mediawiki dir.

Vagrant should be using the composer merge plugin to install the dependencies for extensions such as Wikibase and WikibaseQualityConstaints.

Mvolz added a comment.EditedMar 14 2019, 11:55 AM

Update, checked this again and still getting a similar error (missing dependencies) with a completely fresh install of vagrant / wikidata role.

Fatal error: Uncaught Error: Class 'Wikibase\DataModel\Entity\ItemId' not found in /vagrant/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php:35 Stack trace: #0 /vagrant/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(529): require() #1 /vagrant/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(760): Wikibase\Client\WikibaseClient::getDefaultEntityTypes() #2 /vagrant/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(931): Wikibase\Client\WikibaseClient::newInstance() #3 /vagrant/mediawiki/extensions/Wikibase/client/ClientHooks.php(185): Wikibase\Client\WikibaseClient::getDefaultInstance() #4 /vagrant/mediawiki/includes/Hooks.php(174): Wikibase\ClientHooks::onBeforePageDisplay(Object(OutputPage), Object(SkinVector)) #5 /vagrant/mediawiki/includes/Hooks.php(234): Hooks::callHook('BeforePageDispl...', Array, Array, NULL, '\\Wikibase\\Clien...') #6 /vagrant/mediawiki/includes/OutputPage.php(2706): Hooks::runWithoutAbort('BeforePageDispl...', Array) #7 /vagrant/mediawi in /vagrant/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php on line 35

a composer update from the mediawiki directory (as suggested above) whilst ssh-ed into the vagrant machine fixes that error.

But then I get a new one:

[59f681082f8d3edda56450ab] /wiki/Main_Page Wikimedia\Rdbms\DBQueryError from line 1522 of /vagrant/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT ips_item_id FROM `wb_items_per_site` WHERE ips_site_id = 'enwiki' AND ips_site_page = 'Main Page' LIMIT 1 
Function: Wikimedia\Rdbms\Database::selectRow
Error: 1146 Table 'wikidatawiki.wb_items_per_site' doesn't exist (127.0.0.1)

Running

mwscript maintenance/update.php --wiki=wiki

had no effect, still get the error.

Mvolz added a comment.Mar 14 2019, 2:10 PM

Update, checked this again and still getting a similar error (missing dependencies) with a completely fresh install of vagrant / wikidata role.

Fatal error: Uncaught Error: Class 'Wikibase\DataModel\Entity\ItemId' not found in /vagrant/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php:35 Stack trace: #0 /vagrant/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(529): require() #1 /vagrant/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(760): Wikibase\Client\WikibaseClient::getDefaultEntityTypes() #2 /vagrant/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(931): Wikibase\Client\WikibaseClient::newInstance() #3 /vagrant/mediawiki/extensions/Wikibase/client/ClientHooks.php(185): Wikibase\Client\WikibaseClient::getDefaultInstance() #4 /vagrant/mediawiki/includes/Hooks.php(174): Wikibase\ClientHooks::onBeforePageDisplay(Object(OutputPage), Object(SkinVector)) #5 /vagrant/mediawiki/includes/Hooks.php(234): Hooks::callHook('BeforePageDispl...', Array, Array, NULL, '\\Wikibase\\Clien...') #6 /vagrant/mediawiki/includes/OutputPage.php(2706): Hooks::runWithoutAbort('BeforePageDispl...', Array) #7 /vagrant/mediawi in /vagrant/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php on line 35

a composer update from the mediawiki directory (as suggested above) whilst ssh-ed into the vagrant machine fixes that error.

But then I get a new one:

[59f681082f8d3edda56450ab] /wiki/Main_Page Wikimedia\Rdbms\DBQueryError from line 1522 of /vagrant/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT ips_item_id FROM `wb_items_per_site` WHERE ips_site_id = 'enwiki' AND ips_site_page = 'Main Page' LIMIT 1 
Function: Wikimedia\Rdbms\Database::selectRow
Error: 1146 Table 'wikidatawiki.wb_items_per_site' doesn't exist (127.0.0.1)

Running

mwscript maintenance/update.php --wiki=wiki

had no effect, still get the error.

Works after disabling/enabling again and re-provisioning.