Page MenuHomePhabricator

InvalidArgumentException: "property is not provided by source" (via wbeditentity API)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Can be triggered when trying to use the wbeditentity api on commons to edit a property.
Also happens when using other edit apis.
Also happens when editing via special pages

This should probably return a nice error instead.

Reproduction:

https://commons.wikimedia.org/wiki/Special:ApiSandbox#action=wbeditentity&format=json&id=P369&summary=TEST&token=XXXX&data=%7B%7D&clear=1

Error

MediaWiki version: 1.35.0-wmf.15 (but will exist in many previous versions)

message
Entities of type: property is not provided by source: local

Impact

This is not an expected execution path, so impact is low.
But when performed will currently produce logspam

Notes

Details

Request ID
XiBJBgpAAEcAAFF5PZ0AAABK
Request URL
https://commons.wikimedia.org/w/api.php
Stack Trace
InvalidArgumentException: Entities of type: property is not provided by source: local

/srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php:132
exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(112): Wikibase\Repo\Store\Sql\WikiPageEntityStore->assertEntityIdFromKnownSource(Wikibase\DataModel\Entity\PropertyId)
#1 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(572): Wikibase\Repo\Store\Sql\WikiPageEntityStore->assertCanStoreEntity(Wikibase\DataModel\Entity\PropertyId)
#2 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityStore.php(169): Wikibase\Repo\Store\Sql\WikiPageEntityStore->isWatching(User, Wikibase\DataModel\Entity\PropertyId)
#3 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEntityStore.php(84): Wikibase\Lib\Store\TypeDispatchingEntityStore->isWatching(User, Wikibase\DataModel\Entity\PropertyId)
#4 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(782): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore->isWatching(User, Wikibase\DataModel\Entity\PropertyId)
#5 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(550): Wikibase\Repo\EditEntity\MediawikiEditEntity->getWatchDefault()
#6 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(631): Wikibase\Repo\EditEntity\MediawikiEditEntity->getDesiredWatchState(NULL)
#7 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEditEntity.php(74): Wikibase\Repo\EditEntity\MediawikiEditEntity->attemptSave(Wikibase\DataModel\Entity\Property, string, integer, string, NULL, array)
#8 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/Api/EntitySavingHelper.php(366): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEditEntity->attemptSave(Wikibase\DataModel\Entity\Property, string, integer, string, NULL, array)
#9 /srv/mediawiki/php-1.35.0-wmf.15/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(323): Wikibase\Repo\Api\EntitySavingHelper->attemptSaveEntity(Wikibase\DataModel\Entity\Property, string)
#10 /srv/mediawiki/php-1.35.0-wmf.15/includes/api/ApiMain.php(1603): Wikibase\Repo\Api\ModifyEntity->execute()
#11 /srv/mediawiki/php-1.35.0-wmf.15/includes/api/ApiMain.php(539): ApiMain->executeAction()
#12 /srv/mediawiki/php-1.35.0-wmf.15/includes/api/ApiMain.php(510): ApiMain->executeActionWithErrorHandling()
#13 /srv/mediawiki/php-1.35.0-wmf.15/api.php(78): ApiMain->execute()
#14 /srv/mediawiki/w/api.php(3): require(string)
#15 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore renamed this task from Entities of type: property is not provided by source: local to Entities of type: property is not provided by source: local , using wbeditentity.Jan 16 2020, 11:43 AM
Addshore updated the task description. (Show Details)

It's not up to me to triage this but given @Addshore's impact analysis I guess it is safe to rule out UBN.

Krinkle renamed this task from Entities of type: property is not provided by source: local , using wbeditentity to InvalidArgumentException: "property is not provided by source" (via wbeditentity API).Jan 23 2020, 11:54 AM
Krinkle edited Stack Trace. (Show Details)
Krinkle moved this task from Untriaged to Jan2020/1.35-wmf.14 on the Wikimedia-production-error board.
Krinkle subscribed.

It now responds differnetly, suggesting that the issue has been acknowledge in the code as the user/input error that it is, and thus no longer causes a PHP crash:

{
    "error": {
        "code": "param-illegal",
        "info": "A datatype was expected, but either missing or not recognized.",
        "messages": [
            {
                "name": "wikibase-api-not-recognized-datatype",
                "parameters": [],
                "html": {
                    "*": "A datatype was expected, but either missing or not recognized."
                }
            }
        ],