Inability to lock via setglobalaccountstatus API in mw 1.29
Closed, ResolvedPublic

Description

While using a script designed to easily lock accounts on a wiki farm recently upgraded to mw 1.29.1 (using the relevant version of CA), I noticed that the script no longer locked user accounts, but also did not report an error. I therefore took to the ApiSandbox to more easily process the results from testing, as well as to be sure that it was not the script causing these errors. Using the format of

{
	"action": "setglobalaccountstatus",
	"user": "Void-test",
	"locked": "lock",
	"reason": "Testing API",
}

(format and token omitted), I obtained these results from the various formats:

{
    "setglobalaccountstatus": {
        "user": "Void-test",
        "hidden": "",
        "reason": "Testing API"
    }
}

a:1:{s:22:"setglobalaccountstatus";a:3:{s:4:"user";s:9:"Void-test";s:6:"hidden";s:0:"";s:6:"reason";s:11:"Testing API";}}

{
    "setglobalaccountstatus": {
        "user": "Void-test",
        "locked": false,
        "hidden": "",
        "reason": "Testing API"
    },
    "_type": "assoc"
}

<?xml version="1.0"?>
<api>
  <setglobalaccountstatus user="Void-test" hidden="" reason="Testing API" />
</api>

Only rawfm acknowledges the locked state of the account. None change the fact that the account remains unlocked. If I lock the account before running a test, the end result is that the account is unlocked. I do not believe that the output changes.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSun, Sep 10, 1:42 AM
Legoktm claimed this task.Sun, Sep 10, 6:07 AM
Legoktm added a project: Regression.
Legoktm added a subscriber: Legoktm.

Nice find, this is a regression from rECAU6b4dda7de6a2: Update for API error i18n.

Change 377038 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/CentralAuth@master] API: Unbreak setglobalaccountstatus locked=lock

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

@MarcoAurelio do you know if any Wikimedia Stewards are using this particular API module to lock accounts? It probably hasn't been working on Wikimedia sites since January 2017.

@Legoktm I don't think any of us is using API manually to do that stuff. We mostly rely on Special:CentralAuth and Special:MultiLock, so I don't think we're affected. I'll ask my peers nonetheless just to be sure. Thanks for the ping. Regards.

RuyP added a subscriber: RuyP.Sun, Sep 10, 6:56 PM

I've never used this API module as well.

It seems it's not working at Meta-Wiki: P5982

Change 377038 merged by jenkins-bot:
[mediawiki/extensions/CentralAuth@master] API: Unbreak setglobalaccountstatus locked=lock

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

Shall we cherry-pick the above to the current wmf branch & others until at least when the bug appeared, and its releases?

Change 377316 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/CentralAuth@REL1_29] API: Unbreak setglobalaccountstatus locked=lock

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

Shall we cherry-pick the above to the current wmf branch & others until at least when the bug appeared, and its releases?

I cherry-picked it to REL1_29, but if no one is apparently using it on Wikimedia sites, I'd rather it just ride the normal train and reach Meta on Wednesday.

Change 377316 merged by jenkins-bot:
[mediawiki/extensions/CentralAuth@REL1_29] API: Unbreak setglobalaccountstatus locked=lock

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

Change 377326 had a related patch set uploaded (by MarcoAurelio; owner: Legoktm):
[mediawiki/extensions/CentralAuth@wmf/1.30.0-wmf.17] API: Unbreak setglobalaccountstatus locked=lock

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

With your permission, I'm trying to cherry-pick this to current WMF branch as at least one tool we use from time to time happens to rely on this... zuul volente, as it's currently recovering from downtime and is terribly slow.

With your permission, I'm trying to cherry-pick this to current WMF branch as at least one tool we use from time to time happens to rely on this... zuul volente, as it's currently recovering from downtime and is terribly slow.

Sounds good to me then.

Change 377326 merged by jenkins-bot:
[mediawiki/extensions/CentralAuth@wmf/1.30.0-wmf.17] API: Unbreak setglobalaccountstatus locked=lock

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

MarcoAurelio added a subscriber: ReleaseTaggerBot.

Well, this goes on MW-1.30-release-notes (WMF-deploy-2017-09-12_(1.30.0-wmf.18)) and is cherry picked on MW-1.30-release-notes (WMF-deploy-2017-09-05 (1.30.0-wmf.17)). Given that Phabricator won't let me add both, and given that @ReleaseTaggerBot is down, I'll add the wmf.18 tag as it's when it'll "normally" arrive on other sites.

Mentioned in SAL (#wikimedia-operations) [2017-09-12T13:31:23Z] <hashar@tin> Synchronized php-1.30.0-wmf.17/extensions/CentralAuth/includes/api/ApiSetGlobalAccountStatus.php: API: Unbreak setglobalaccountstatus locked=lock - T175462 (duration: 00m 44s)

MarcoAurelio closed this task as Resolved.Tue, Sep 12, 1:39 PM

Tested and works.

MarcoAurelio triaged this task as Normal priority.Tue, Sep 12, 1:39 PM
MarcoAurelio moved this task from Incoming to Done on the MediaWiki-extensions-CentralAuth board.