Page MenuHomePhabricator

InvalidArgumentException when giving empty aflfilter in list=abuselog API
Closed, ResolvedPublic

Description

https://zh.wikipedia.org/w/api.php?action=query&format=json&list=abuselog&aflfilter=&aflprop=ids%7Cuser%7Ctitle%7Caction%7Cresult%7Ctimestamp%7Chidden%7Crevid%7Cdetails%7Cfilter
{"error":{"code":"internal_api_error_InvalidArgumentException","info":"[XM576gpAAEgAAAby6foAAAAP] Caught exception of type InvalidArgumentException","errorclass":"InvalidArgumentException"},"servedby":"mw1277"}

message
Wikimedia\Rdbms\Database::makeList: empty input for field afl_filter
trace
#0 /srv/mediawiki/php-1.34.0-wmf.3/includes/libs/rdbms/database/Database.php(1835): Wikimedia\Rdbms\Database->makeList(array, integer)
#1 /srv/mediawiki/php-1.34.0-wmf.3/includes/libs/rdbms/database/Database.php(1782): Wikimedia\Rdbms\Database->selectSQLText(array, array, array, string, array, array)
#2 /srv/mediawiki/php-1.34.0-wmf.3/includes/api/ApiQueryBase.php(400): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
#3 /srv/mediawiki/php-1.34.0-wmf.3/extensions/AbuseFilter/includes/api/ApiQueryAbuseLog.php(153): ApiQueryBase->select(string)
#4 /srv/mediawiki/php-1.34.0-wmf.3/includes/api/ApiQuery.php(249): ApiQueryAbuseLog->execute()
#5 /srv/mediawiki/php-1.34.0-wmf.3/includes/api/ApiMain.php(1593): ApiQuery->execute()
#6 /srv/mediawiki/php-1.34.0-wmf.3/includes/api/ApiMain.php(531): ApiMain->executeAction()
#7 /srv/mediawiki/php-1.34.0-wmf.3/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#8 /srv/mediawiki/php-1.34.0-wmf.3/api.php(87): ApiMain->execute()
#9 /srv/mediawiki/w/api.php(3): require(string)
#10 {main}

Event Timeline

A2093064 created this task.May 5 2019, 6:03 AM
Restricted Application added subscribers: Cosine02, Aklapper. · View Herald TranscriptMay 5 2019, 6:03 AM
Daimona updated the task description. (Show Details)May 6 2019, 3:51 PM
Daimona updated the task description. (Show Details)
Daimona added a subscriber: Daimona.

There should probably be a check for the list being empty, and this should not bubble up to the user.

Change 511000 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Don't send empty array to Database::makeList

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

Daimona claimed this task.May 18 2019, 8:56 AM
Daimona moved this task from Backlog to Under review on the User-Daimona board.

Change 511000 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Don't send empty array to Database::makeList

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

Daimona closed this task as Resolved.May 18 2019, 1:16 PM
Daimona moved this task from Under review to Done on the User-Daimona board.
Daimona removed a project: Patch-For-Review.