Page MenuHomePhabricator

Trying to edit anonymously via the API when globally blocked returns a different error code when IP Masking enabled
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

If my IP is globally blocked and I attempt to edit via the API anonymously, the error message I see is:

Without IP Masking:

{
    "error": {
        "code": "globalblocking-blockedtext-range",
        "info": "'''Your IP address is in a range which has been blocked on all wikis.''' The block was made by [[User:Admin|‪Admin‬]]. The reason given is Foobar. * Start of block: 08:11, 21 August 2023 * Expiration of block: infinite You can contact [[User:Admin|‪Admin‬]] to discuss the block. You cannot use the \"Email this user\" feature unless a valid email address is specified in your [[Special:Preferences|account preferences]] and you have not been blocked from using it. Your current IP address is 3.1.1.1. The blocked range is 3.1.1.1/32. Please include all above details in any queries you make.",
        "docref": "See http://localhost:8080/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
    },
    ...

With IP Masking:

{
    "error": {
        "code": "blocked",
        "info": "'''Your IP address is in a range which has been blocked on all wikis.''' The block was made by [[User:Admin|‪Admin‬]]. The reason given is Foobar. * Start of block: 08:11, 21 August 2023 * Expiration of block: infinite You can contact [[User:Admin|‪Admin‬]] to discuss the block. You cannot use the \"Email this user\" feature unless a valid email address is specified in your [[Special:Preferences|account preferences]] and you have not been blocked from using it. Your current IP address is 3.1.1.1. The blocked range is 3.1.1.1/32. Please include all above details in any queries you make.",
        "blockinfo": {
            "blockid": 69,
            "blockedby": "Admin",
            "blockedbyid": 1,
            "blockreason": "Foobar",
            "blockedtimestamp": "2023-08-21T08:11:46Z",
            "blockexpiry": "infinite",
            "blockpartial": false,
            "blocknocreate": true,
            "blockanononly": true,
            "blockemail": false,
            "blockowntalk": true,
            "blockedtimestampformatted": "08:11, 21 August 2023"
        },
        ...

I don't know why there would be a difference.

Steps to reproduce problem
  1. Go to https://en.wikipedia.beta.wmflabs.org/wiki/Special:GlobalBlock and block your IP address
  2. Logout (or open a new browser), go to https://en.wikipedia.beta.wmflabs.org/wiki/Special:ApiSandbox#action=edit&format=json&title=Conflict-title-0.9702253020499916-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&appendtext=foobar and submit
  3. Go to https://de.wikipedia.beta.wmflabs.org/wiki/Spezial:ApiSandbox#action=edit&format=json&title=Web_NDL_Authorities&appendtext=foobar and submit

Expected behavior: Error message in the Results tab should be the same (more or less)
Observed behavior: See the two messages above

Environment

Wiki(s):

  • local docker wiki MediaWiki 1.41.0-alpha (bd31b57) 01:46; 22 August 2023, GlobalBlocking – (dbbdf47) 06:47, 21 August 2023.
  • enwiki and dewiki beta MediaWiki 1.41.0-alpha (709c20e) 12:20, 22 August 2023; GlobalBlocking – (dbbdf47) 06:47, 21 August 2023.

Event Timeline

dom_walden renamed this task from Trying to edit anonymously via the API when globally blocked returns a different code when IP Masking enabled to Trying to edit anonymously via the API when globally blocked returns a different error code when IP Masking enabled.Aug 31 2023, 6:54 AM

@dom_walden can you confirm if this bug still persists?

@dom_walden can you confirm if this bug still persists?

I just tried and I wasn't able to reproduce using the steps in the description.

Please reopen if still an issue