Wikibase crashes with internal API errors when you try to use the API to edit an entity of a type that doesn’t actually live on the current wiki, e.g. trying to call wbsetlabel for a property from Commons. Current error:
InvalidArgumentException: Entity type property cannot be edited on this wiki. from /srv/mediawiki/php-1.39.0-wmf.4/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(629) #0 /srv/mediawiki/php-1.39.0-wmf.4/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(669): Wikibase\Repo\EditEntity\MediawikiEditEntity->checkLocal(Wikibase\DataModel\Entity\Property) #1 /srv/mediawiki/php-1.39.0-wmf.4/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEditEntity.php(77): Wikibase\Repo\EditEntity\MediawikiEditEntity->attemptSave(Wikibase\DataModel\Entity\Property, string, integer, string, NULL, array) #2 /srv/mediawiki/php-1.39.0-wmf.4/extensions/Wikibase/repo/includes/Api/EntitySavingHelper.php(392): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEditEntity->attemptSave(Wikibase\DataModel\Entity\Property, string, integer, string, NULL, array) #3 /srv/mediawiki/php-1.39.0-wmf.4/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(339): Wikibase\Repo\Api\EntitySavingHelper->attemptSaveEntity(Wikibase\DataModel\Entity\Property, string, array, DerivativeContext) #4 /srv/mediawiki/php-1.39.0-wmf.4/includes/api/ApiMain.php(1897): Wikibase\Repo\Api\ModifyEntity->execute()
Previous error / original report:
happens when trying to use wbsetlabel to set a label for a property on Commons.
The API call probably shouldn't actually get this far and should bail out with an error earlier.
Reproduction:
Error
MediaWiki version: 1.35.0-wmf.15 (probably exists in many previous versions), but is also related to the terms storage
A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? Query: SELECT wby_id AS `id`,wby_name AS `name` FROM `wbt_type` ORDER BY id Function: MediaWiki\Storage\NameTableStore::loadTable Error: 1146 Table 'commonswiki.wbt_type' doesn't exist (10.64.48.150)
Impact
This is not an expected execution path, so impact is low.
But when performed will currently produce logspam