Page MenuHomePhabricator

Exception caught: MediaWiki\User\UserEditTracker::getUserEditCount requires a user ID on beta
Closed, ResolvedPublic

Description

Repropduction:

{
error: {
code: "internal_api_error_InvalidArgumentException",
info: "[YFSJPKwQBHcAACBxYkUAAAAB] Exception caught: MediaWiki\User\UserEditTracker::getUserEditCount requires a user ID",
errorclass: "InvalidArgumentException",
*: "InvalidArgumentException at /srv/mediawiki/php-master/includes/user/UserEditTracker.php(65)
from /srv/mediawiki/php-master/includes/user/UserEditTracker.php(65)
#0 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Variables/LazyVariableComputer.php(302): MediaWiki\User\UserEditTracker->getUserEditCount(User)
#1 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Variables/VariablesManager.php(88): MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer->compute(MediaWiki\Extension\AbuseFilter\Variables\LazyLoadedVariable, MediaWiki\Extension\AbuseFilter\Variables\VariableHolder, Closure)
#2 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterParser.php(1204): MediaWiki\Extension\AbuseFilter\Variables\VariablesManager->getVar(MediaWiki\Extension\AbuseFilter\Variables\VariableHolder, string, integer, string)
#3 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(136): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterParser->getVarValue(string)
#4 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(260): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->evalNode(MediaWiki\Extension\AbuseFilter\Parser\AFPTreeNode)
#5 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(267): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->evalNode(MediaWiki\Extension\AbuseFilter\Parser\AFPTreeNode)
#6 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(110): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->evalNode(MediaWiki\Extension\AbuseFilter\Parser\AFPTreeNode)
#7 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(67): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->evalTree(MediaWiki\Extension\AbuseFilter\Parser\AFPSyntaxTree)
#8 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterParser.php(399): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->intEval(string)
#9 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterParser.php(410): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterParser->parse(string)
#10 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterParser.php(289): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterParser->parseDetailed(string)
#11 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/FilterRunner.php(378): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterParser->checkConditions(string, string)
#12 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/FilterRunner.php(344): MediaWiki\Extension\AbuseFilter\FilterRunner->checkFilter(MediaWiki\Extension\AbuseFilter\Filter\ExistingFilter, boolean)
#13 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/FilterRunner.php(231): MediaWiki\Extension\AbuseFilter\FilterRunner->checkAllFiltersInternal()
#14 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/AbuseFilterHooks.php(102): MediaWiki\Extension\AbuseFilter\FilterRunner->run()
#15 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/AbuseFilterHooks.php(45): MediaWiki\Extension\AbuseFilter\AbuseFilterHooks::filterEdit(DerivativeContext, User, Wikibase\Repo\Content\ItemContent, string, string)
#16 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(330): MediaWiki\Extension\AbuseFilter\AbuseFilterHooks::onEditFilterMergedContent(DerivativeContext, Wikibase\Repo\Content\ItemContent, Status, string, User, boolean, string)
#17 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#18 /srv/mediawiki/php-master/includes/Hooks.php(137): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#19 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditFilterHookRunner.php(115): Hooks::run(string, array)
#20 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/EditEntity/StatsdTimeRecordingEditFilterHookRunner.php(47): Wikibase\Repo\EditEntity\MediawikiEditFilterHookRunner->run(Wikibase\DataModel\Entity\Item, User, string)
#21 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(718): Wikibase\Repo\EditEntity\StatsdTimeRecordingEditFilterHookRunner->run(Wikibase\DataModel\Entity\Item, User, string)
#22 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEditEntity.php(77): Wikibase\Repo\EditEntity\MediawikiEditEntity->attemptSave(Wikibase\DataModel\Entity\Item, string, integer, string, boolean, array)
#23 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Api/EntitySavingHelper.php(377): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEditEntity->attemptSave(Wikibase\DataModel\Entity\Item, string, integer, string, NULL, array)
#24 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(329): Wikibase\Repo\Api\EntitySavingHelper->attemptSaveEntity(Wikibase\DataModel\Entity\Item, string)
#25 /srv/mediawiki/php-master/includes/api/ApiMain.php(1646): Wikibase\Repo\Api\ModifyEntity->execute()
#26 /srv/mediawiki/php-master/includes/api/ApiMain.php(616): ApiMain->executeAction()
#27 /srv/mediawiki/php-master/includes/api/ApiMain.php(587): ApiMain->executeActionWithErrorHandling()
#28 /srv/mediawiki/php-master/api.php(90): ApiMain->execute()
#29 /srv/mediawiki/php-master/api.php(45): wfApiMain()
#30 /srv/mediawiki/w/api.php(3): require(string)
#31 {main}"
},
servedby: "deployment-mediawiki-07"
}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I tried this edit path on test.wikidata.org but couldn't reproduce it.
This could have something to do with either the change in T271215 OR just with beta in general...

I can reproduce on beta by just going to https://m.wikidata.beta.wmflabs.org/wiki/Special:NewItem and trying to make an item....

[YFSLAqwQBHcAACBxZnkAAAAA] /wiki/Special:NewItem InvalidArgumentException: MediaWiki\User\UserEditTracker::getUserEditCount requires a user ID

Backtrace:

from /srv/mediawiki/php-master/includes/user/UserEditTracker.php(65)
#0 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Variables/LazyVariableComputer.php(302): MediaWiki\User\UserEditTracker->getUserEditCount(User)
#1 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Variables/VariablesManager.php(88): MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer->compute(MediaWiki\Extension\AbuseFilter\Variables\LazyLoadedVariable, MediaWiki\Extension\AbuseFilter\Variables\VariableHolder, Closure)
#2 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterParser.php(1204): MediaWiki\Extension\AbuseFilter\Variables\VariablesManager->getVar(MediaWiki\Extension\AbuseFilter\Variables\VariableHolder, string, integer, string)
#3 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(136): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterParser->getVarValue(string)
#4 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(260): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->evalNode(MediaWiki\Extension\AbuseFilter\Parser\AFPTreeNode)
#5 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(267): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->evalNode(MediaWiki\Extension\AbuseFilter\Parser\AFPTreeNode)
#6 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(110): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->evalNode(MediaWiki\Extension\AbuseFilter\Parser\AFPTreeNode)
#7 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterCachingParser.php(67): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->evalTree(MediaWiki\Extension\AbuseFilter\Parser\AFPSyntaxTree)
#8 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterParser.php(399): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterCachingParser->intEval(string)
#9 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterParser.php(410): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterParser->parse(string)
#10 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/Parser/AbuseFilterParser.php(289): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterParser->parseDetailed(string)
#11 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/FilterRunner.php(378): MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterParser->checkConditions(string, string)
#12 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/FilterRunner.php(344): MediaWiki\Extension\AbuseFilter\FilterRunner->checkFilter(MediaWiki\Extension\AbuseFilter\Filter\ExistingFilter, boolean)
#13 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/FilterRunner.php(231): MediaWiki\Extension\AbuseFilter\FilterRunner->checkAllFiltersInternal()
#14 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/AbuseFilterHooks.php(102): MediaWiki\Extension\AbuseFilter\FilterRunner->run()
#15 /srv/mediawiki/php-master/extensions/AbuseFilter/includes/AbuseFilterHooks.php(45): MediaWiki\Extension\AbuseFilter\AbuseFilterHooks::filterEdit(RequestContext, User, Wikibase\Repo\Content\ItemContent, string, string)
#16 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(330): MediaWiki\Extension\AbuseFilter\AbuseFilterHooks::onEditFilterMergedContent(RequestContext, Wikibase\Repo\Content\ItemContent, Status, string, User, boolean, string)
#17 /srv/mediawiki/php-master/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#18 /srv/mediawiki/php-master/includes/Hooks.php(137): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#19 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditFilterHookRunner.php(115): Hooks::run(string, array)
#20 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/EditEntity/StatsdTimeRecordingEditFilterHookRunner.php(47): Wikibase\Repo\EditEntity\MediawikiEditFilterHookRunner->run(Wikibase\DataModel\Entity\Item, User, string)
#21 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(718): Wikibase\Repo\EditEntity\StatsdTimeRecordingEditFilterHookRunner->run(Wikibase\DataModel\Entity\Item, User, string)
#22 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEditEntity.php(77): Wikibase\Repo\EditEntity\MediawikiEditEntity->attemptSave(Wikibase\DataModel\Entity\Item, string, integer, string, boolean, array)
#23 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Specials/SpecialWikibaseRepoPage.php(186): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEditEntity->attemptSave(Wikibase\DataModel\Entity\Item, string, integer, string)
#24 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Specials/SpecialNewEntity.php(164): Wikibase\Repo\Specials\SpecialWikibaseRepoPage->saveEntity(Wikibase\DataModel\Entity\Item, Wikibase\Lib\Summary, string, integer)
#25 /srv/mediawiki/php-master/includes/htmlform/HTMLForm.php(714): Wikibase\Repo\Specials\SpecialNewEntity->Wikibase\Repo\Specials\{closure}(array, OOUIHTMLForm)
#26 /srv/mediawiki/php-master/includes/htmlform/HTMLForm.php(604): HTMLForm->trySubmit()
#27 /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Specials/SpecialNewEntity.php(108): HTMLForm->tryAuthorizedSubmit()
#28 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(646): Wikibase\Repo\Specials\SpecialNewEntity->execute(NULL)
#29 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(1376): SpecialPage->run(NULL)
#30 /srv/mediawiki/php-master/includes/MediaWiki.php(309): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#31 /srv/mediawiki/php-master/includes/MediaWiki.php(925): MediaWiki->performRequest()
#32 /srv/mediawiki/php-master/includes/MediaWiki.php(547): MediaWiki->main()
#33 /srv/mediawiki/php-master/index.php(53): MediaWiki->run()
#34 /srv/mediawiki/php-master/index.php(46): wfIndexMain()
#35 /srv/mediawiki/w/index.php(3): require(string)
#36 {main}

Change 673469 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Fix fatal when computing user_editcount for anons

https://gerrit.wikimedia.org/r/673469

Change 673469 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Fix fatal when computing user_editcount for anons

https://gerrit.wikimedia.org/r/673469