Page MenuHomePhabricator

AbuseFilter shouldn't publish `udp` LogEntries with $newId=0
Closed, ResolvedPublicPRODUCTION ERROR

Description

The AbuseFilter is causing logspam with newId and/or revId must be set when calling ManualLogEntry::publish() error messages.
Stacktrace:

#0 /srv/mediawiki/php-1.33.0-wmf.23/extensions/AbuseFilter/includes/AbuseFilter.php(1461): ManualLogEntry->publish(integer, string)
#1 /srv/mediawiki/php-1.33.0-wmf.23/extensions/AbuseFilter/includes/AbuseFilter.php(1267): AbuseFilter::addLogEntries(array, array, AbuseFilterVariableHolder, string)
#2 /srv/mediawiki/php-1.33.0-wmf.23/extensions/AbuseFilter/includes/AbuseFilterHooks.php(140): AbuseFilter::filterAction(AbuseFilterVariableHolder, Title, string, User)
#3 /srv/mediawiki/php-1.33.0-wmf.23/extensions/AbuseFilter/includes/AbuseFilterHooks.php(62): AbuseFilterHooks::filterEdit(DerivativeContext, Wikibase\ItemContent, string, Status, string, string)
#4 /srv/mediawiki/php-1.33.0-wmf.23/includes/Hooks.php(174): AbuseFilterHooks::onEditFilterMergedContent(DerivativeContext, Wikibase\ItemContent, Status, string, User, boolean, string)
#5 /srv/mediawiki/php-1.33.0-wmf.23/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#6 /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditFilterHookRunner.php(116): Hooks::run(string, array)
#7 /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/repo/includes/EditEntity/StatsdTimeRecordingEditFilterHookRunner.php(44): Wikibase\Repo\EditEntity\MediawikiEditFilterHookRunner->run(Wikibase\DataModel\Entity\Item, User, string)
#8 /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(692): Wikibase\Repo\EditEntity\StatsdTimeRecordingEditFilterHookRunner->run(Wikibase\DataModel\Entity\Item, User, string)
#9 /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEditEntity.php(73): Wikibase\Repo\EditEntity\MediawikiEditEntity->attemptSave(Wikibase\DataModel\Entity\Item, string, integer, string, boolean)
#10 /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/repo/includes/Api/EntitySavingHelper.php(351): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEditEntity->attemptSave(Wikibase\DataModel\Entity\Item, string, integer, string)
#11 /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(310): Wikibase\Repo\Api\EntitySavingHelper->attemptSaveEntity(Wikibase\DataModel\Entity\Item, string)
#12 /srv/mediawiki/php-1.33.0-wmf.23/includes/api/ApiMain.php(1595): Wikibase\Repo\Api\ModifyEntity->execute()
#13 /srv/mediawiki/php-1.33.0-wmf.23/includes/api/ApiMain.php(531): ApiMain->executeAction()
#14 /srv/mediawiki/php-1.33.0-wmf.23/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#15 /srv/mediawiki/php-1.33.0-wmf.23/api.php(87): ApiMain->execute()
#16 /srv/mediawiki/w/api.php(3): include(string)
#17 {main}

It's caused by the fact that AbuseFilter::addLogEntries() calls ManualLogEntry::publish( 0, 'udp' ); which is invalid call. The $newId has to be present, otherwise Logs system won't be able to save the tags associated with the log entry.

For more information please refer to T218940

Event Timeline

Change 499766 had a related patch set uploaded (by Pmiazga; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Don't publish LogEntries without ID

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

Change 499766 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Don't publish LogEntries without ID

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

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM