Page MenuHomePhabricator

Special:EntitiesWithout* allows selecting Lexeme, however it just throws an exception
Closed, ResolvedPublic5 Estimated Story PointsPRODUCTION ERROR

Description

Bug Description

https://wikidata.beta.wmflabs.org/wiki/Special:EntitiesWithoutLabel

https://wikidata.beta.wmflabs.org/wiki/Special:EntitiesWithoutLabel?language=en&type=lexeme

Also happens on Special:EntitiesWithoutDescription

[WvQX5wpEEj4AAF5@OaYAAAAG] /wiki/Special:EntitiesWithoutLabel?language=en&type=lexeme InvalidArgumentException from line 189 of /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Store/Sql/SqlEntitiesWithoutTermFinder.php: $entityTypes can not contain unsupported entity types.

Backtrace:

#0 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Store/Sql/SqlEntitiesWithoutTermFinder.php(77): Wikibase\Repo\Store\Sql\SqlEntitiesWithoutTermFinder->normalizeEntityTypes(array)
#1 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Specials/SpecialEntitiesWithoutPage.php(230): Wikibase\Repo\Store\Sql\SqlEntitiesWithoutTermFinder->getEntitiesWithoutTerm(string, string, array, integer, integer)
#2 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Specials/SpecialWikibaseQueryPage.php(113): Wikibase\Repo\Specials\SpecialEntitiesWithoutPage->getResult(integer, integer)
#3 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Specials/SpecialEntitiesWithoutPage.php(102): Wikibase\Repo\Specials\SpecialWikibaseQueryPage->showQuery()
#4 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(522): Wikibase\Repo\Specials\SpecialEntitiesWithoutPage->execute(NULL)
#5 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#6 /srv/mediawiki/php-master/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#7 /srv/mediawiki/php-master/includes/MediaWiki.php(861): MediaWiki->performRequest()
#8 /srv/mediawiki/php-master/includes/MediaWiki.php(524): MediaWiki->main()
#9 /srv/mediawiki/php-master/index.php(42): MediaWiki->run()
#10 /srv/mediawiki/w/index.php(3): include(string)
#11 {main}

Impact & priority
This is mildly annoying for users as the UI suggestions that they should try to do something that will never work (lexemes without labels).
The fact that the exception is uncaught means that it turns up in the production logs which adds to the logspam that deployers have to hunt through when identifying issues.

Fix Part 1: Fixing the exception bubble up

The main exception being thrown by SqlEntitiesWithoutTermFinder->normalizeEntityTypes can remain.
But it needs to be caught before bubbling up to the user.
It might make sense to catch it further up and rethrow a more specific exception than InvalidArgumentException to be caught by the SpecialPage.
The SpecialPage can then just return an error saying that the request entity type is not supported by the page.

Fix Part 2: Fixing the UI...

SpecialEntitiesWithoutPage only deals with entities without terms
SpecialEntitiesWithoutPageFactory currently passes in all entity types from $wikibaseRepo->getLocalEntityTypes()
It looks like we already have a setting for this, supportedEntityTypesForEntitiesWithoutTermListings, but it is null by default.
We can set this in WMF production to no longer suggest lexeme etc on the special page in the first place

Acceptance Criteria

  • When an entity without terms is used on the special page the user should be presented with a helpful error message instead of a raw exception
  • WMF production should only list the entities that have terms on the special page in the first place.

Event Timeline

Addshore created this task.May 10 2018, 9:59 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 10 2018, 9:59 AM
Addshore renamed this task from Special:EntitiesWithoutLabel allows selecting Lexeme, however it just throws an exception to Special:EntitiesWithout* allows selecting Lexeme, however it just throws an exception.May 10 2018, 10:00 AM
Addshore updated the task description. (Show Details)

Causing a very small amount of logspam

[WwZm6wpAIDAAALVjL9EAAACD] /wiki/Special:EntitiesWithoutLabel/de?language=nb&type=lexeme InvalidArgumentException from line 189 of /srv/mediawiki/php-1.32.0-wmf.5/extensions/Wikibase/repo/includes/Store/Sql/SqlEntitiesWithoutTermFinder.php: $entityTypes can not contain unsupported entity types.

We should remove Lexemes and Forms (and later also Senses) from this list.

Lydia_Pintscher triaged this task as Low priority.May 27 2018, 3:26 PM
Vvjjkkii renamed this task from Special:EntitiesWithout* allows selecting Lexeme, however it just throws an exception to 17caaaaaaa.Jul 1 2018, 1:10 AM
Vvjjkkii raised the priority of this task from Low to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from 17caaaaaaa to Special:EntitiesWithout* allows selecting Lexeme, however it just throws an exception.Jul 2 2018, 4:51 AM
CommunityTechBot lowered the priority of this task from High to Low.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.
Addshore updated the task description. (Show Details)
Addshore moved this task from Incoming to Research on the wdwb-tech-focus board.
Lydia_Pintscher lowered the priority of this task from High to Low.Sep 2 2018, 3:38 PM
Addshore updated the task description. (Show Details)Sep 10 2018, 9:43 AM
Addshore moved this task from Incoming to Ready to estimate on the Wikidata-Campsite board.
Addshore moved this task from incoming to consider for next sprint on the Wikidata board.
Addshore moved this task from Research to Goals on the wdwb-tech-focus board.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:09 PM