Page MenuHomePhabricator

AWB reads old writeapi user right, so stops working on wikis when it is removed
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Attempting to log in to AWB on with en.Wikisource as the project (happening with multiple editors).

What happens?:

Fails to initiate, message is: "This user doesn't have enough privileges to make automatic edits on this wiki".

What should have happened instead?:

Regular login and editing.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

This is a WMF-hosted wiki

Other information (browser name/version, screenshots, etc.):

High priority please, used project-wide.

Event Timeline

Xover subscribed.

If this is due to T294397, then as a result if it getting rolled back in T371977 the problem should now be gone. @BD2412 could you retest and report results here?

Reposting from the discussion on Scriptorium: I'm still getting the same error here on enws and all other sites I've checked, except Wikipedia. With Wikipedias:

  • If I try to log in to en Wikipedia where I'm added to Project:AutoWikiBrowser/CheckPageJSON, it works fine
  • If I try to log in to one which doesn't have Project:AutoWikiBrowser/CheckPageJSON (the first one I found was be-tarask Wikipedia), it logs in fine
  • If I try to log in to one which has Project:AutoWikiBrowser/CheckPageJSON, but I'm not added to it, I get a different error message "Yodin is not enabled to use this", and when I click OK, I'm taken to the relevant Project:AutoWikiBrowser/CheckPageJSON page

Is it possible that the rollback is delayed for some reason on non Wikipedia sites (caching, etc.?)

I still get this error (sv.wikipedia).

I'm now getting the "This user doesn't have enough privileges to make automatic edits on this wiki" error with all Wikipedias, even en Wikipedia.

JJMC89 renamed this task from AWB not working on en.Wikisource to AWB not working on Wikimedia projects due to removed writeapi user right.Aug 8 2024, 6:23 PM

If this is due to T294397, then as a result if it getting rolled back in T371977 the problem should now be gone. @BD2412 could you retest and report results here?

Still unable to begin new instances of AWB on *any* Wikimedia project.

The AWB breakage is specifically: format=xml&action=query with a body &meta=userinfo&uiprop=blockinfo|hasmsg|groups|rights returns a rights element that no longer includes <r>writeapi</r> (English Wikipedia)

@Reedy, @Tgr, @Jdforrester-WMF: is the mw-core code removal worth this collateral damage?

Jdforrester-WMF renamed this task from AWB not working on Wikimedia projects due to removed writeapi user right to AWB reads old writeapi user right, so stops working on wikis when it is removed.Aug 9 2024, 9:07 AM

It looks like the code is hosted at https://sourceforge.net/p/autowikibrowser/code/HEAD/tree/AWB/ (?). Someone more familiar should patch the code to not load the right.

It looks like the code is hosted at https://sourceforge.net/p/autowikibrowser/code/HEAD/tree/AWB/ (?). Someone more familiar should patch the code to not load the right.

The code block

if (!User.HasRight("writeapi"))
{
    return WikiStatusResult.NoRights;
}

at line 337 of WikiFunctions/Session.cs needs to be removed.

This patch is more complicated to revert than the other one so I think this should be fixed on the AWB side.

This patch is more complicated to revert than the other one so I think this should be fixed on the AWB side.

Though I guess we can just re-add it temporarily, no need to revert the patch.

Change #1061054 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[operations/mediawiki-config@master] Temporarily re-add writeapi userright until AWB stops depending on it

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

AWB version 6.3.1.0 has been released, and I've been using it at enwiki for the last few hours. It can be accessed from "Help > Check for updates" within AWB.

I'm not familiar with how updates to the AWB codebase are managed, but the copy of Session.cs at svn.code.sf.net/p/autowikibrowser/code/AWB/WikiFunctions/Session.cs has the "writeapi" code section commented out.

It looks like the code is hosted at https://sourceforge.net/p/autowikibrowser/code/HEAD/tree/AWB/ (?). Someone more familiar should patch the code to not load the right.

The code block

if (!User.HasRight("writeapi"))
{
    return WikiStatusResult.NoRights;
}

at line 337 of WikiFunctions/Session.cs needs to be removed.

This patch is more complicated to revert than the other one so I think this should be fixed on the AWB side.

https://sourceforge.net/p/autowikibrowser/code/12616/

I’d already fixed that yesterday

Thanks for the quick fix. 👍 Unfortunately, AWB now requires users to be added to Project:AutoWikiBrowser/CheckPageJSON, even if that page does not exist on the wiki (e.g. en.wikisource). If the page didn't exist, then in the previous version of AWB, you could log in and edit. @Reedy Is this change intentional?

Change #1061054 abandoned by Gergő Tisza:

[operations/mediawiki-config@master] Temporarily re-add writeapi userright until AWB stops depending on it

Reason:

not needed

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

Site:sv.wikipedia.
Updated to 6.3.1. Created page "Wikipedia:AutoWikiBrowser/CheckPageJSON" as it didn't exist before. Now I get "Check page failed to load".

Site:pl.wikipedia
Same as Kitayama - "Check page failed to load".

Site:sv.wikipedia.
Updated to 6.3.1. Created page "Wikipedia:AutoWikiBrowser/CheckPageJSON" as it didn't exist before. Now I get "Check page failed to load".

Probably a side effect from removing the 404 handling in r12629?

Amended the JSON-file. Was: only enableduser Now: Both enabledusers and enabledbots. Now log in works for both users and bots.

@Reedy, @Tgr, @Jdforrester-WMF: is the mw-core code removal worth this collateral damage?

In general, yes, I think removing core code and occasionally breaking things is better than never removing code because something somewhere might break.

Specifically in this case, there are a number of things I could have done better:

  • I should have checked global-search, not just codesearch.
  • As noted in T371977#10054051, I assumed the writeapi field in siteinfo is deprecated, but it actually wasn't, so the change didn't follow the deprecation policy.
  • The removal of the user right also didn't follow deprecation policy. We don't have such a policy per se for user rights, but given that they are queriable via the API, in hindsight I should have treated it as covered by the API deprecation policy.

The action API deprecation policy is not very detailed (it wasn't written with the intent of being a policy), I'll propose something that captures the things learned here.

FYI, the problem has been solved for me by updating to AWB version 6.3.10. -BD

...and by creating Wikipedia:AutoWikiBrowser/CheckPageJSON with list of enabled users and bots on Wiki's which previously didn't have that.

In 6.3.1.1 there is no need for the Wikipedia:AutoWikiBrowser/CheckPageJSON. And if it exists, you don't have to be in the list.
Tested on sv.wikipedia. I can log in in AWB with users not existing in the JSON-file. If I remove the JSON-file, I can still log in.

The AWB fix was checked in on Aug 8 and then released as part of a forced update. But that also rolled up all other changes made since the 6.3.0.1 release (with some other improvements), but any regressions that show up should be reported on the en wiki AWB project page.