Page MenuHomePhabricator

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

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

Daimona updated the task description. (Show Details)
Daimona subscribed.

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

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 moved this task from Under review to Done on the User-Daimona board.
Daimona removed a project: Patch-For-Review.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM