Page MenuHomePhabricator

Passing modify=true to globalblocks no longer works reliably
Closed, ResolvedPublic

Description

I attempted to mass-block few ranges via the gadget stewards have available to them, and it didn't do anything. I investigated, and I noticed this API call:

{
	"action": "globalblock",
	"format": "json",
	"target": "213.202.232.64",
	"expiry": "1 minute",
	"reason": "Testing",
	"modify": 1,
	"token": "redacted"
}

consistently fails in Wikimedia production. So far, I'm unable to reproduce with beta or dev setup.

Response from production:

{
    "error": {
        "globalblock": [
            {
                "code": "globalblocking-block-failure",
                "message": "An error occurred while attempting to globally block 213.202.232.64. Please try again."
            }
        ]
    }
}

Submitting the very same request, but with 127.0.0.5 works fine.

Event Timeline

This is caused by sending "modify": 1 when the IP is not blocked, and instead of fixing I added a test for that exact reason, go me! I'll submit a patch soon.

Change 756062 had a related patch set uploaded (by Tks4Fish; author: Tks4Fish):

[mediawiki/extensions/GlobalBlocking@master] GlobalBlocking: Handle trying to modify a block when no block exists

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

Tks4Fish edited projects, added User-Tks4Fish; removed Patch-For-Review.
Tks4Fish added a project: Patch-For-Review.
Tks4Fish moved this task from Up next to Working on on the User-Tks4Fish board.

Change 756062 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] GlobalBlocking: Handle trying to modify a block when no block exists

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