Page MenuHomePhabricator

add_text.py returns User "None" does not have required user right "edit"
Closed, ResolvedPublicBUG REPORT

Description

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

  • Using add_text.py in any page.

What happens?:

Every task I try to use add_text.py returns the message:

WARNING: No user is logged in on site <wiki>:en
ERROR: Skipping <page> because of a save related error: Edit to page [[<page>]] failed:
User "None" does not have required user right "edit"

What should have happened instead?:

The pages should have a user defined string appended to it

Software version (skip for WMF-hosted wikis like Wikipedia):
A miraheze hosted wiki (Mediawiki 1.39 (3bfcc3f))
Tried with both the latest git version (Pywikibot: [https] r-pywikibot-core.git (211b93e, g17594, 2023/03/06, 13:18:27, stable) and the latest stable (Pywikibot: [https] r-pywikibot-core.git (db3977e, g1, 2023/03/04, 16:38:33, OUTDATED).
Windows 11 build 22621.1344, x64, Python 3.11.0.

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

Other commands like replace.py work fine on the exact same wikis and pages so it's not a permission error.

Event Timeline

Please run the login.py script first. What happens then?

Please run the login.py script first. What happens then?

login.py runs sucessfully every time, and so do other scripts I tried, the only one that has issues is add_text.py

Update: I added my wikipedia credentials and tried add_text on my user sandbox page, it worked fine there.

I then tried a different miraheze account and the same exact error came up in 2 different wikis, could it be something related to the custom families?

Xqt triaged this task as High priority.Mar 7 2023, 8:55 AM

Update: I added my wikipedia credentials and tried add_text on my user sandbox page, it worked fine there.

I then tried a different miraheze account and the same exact error came up in 2 different wikis, could it be something related to the custom families?

Seems there is a difference how login on a "private" wiki works where login is always required for edits, see T328814 for example.

Change 906547 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [bugfix] No longer lazy load cookies

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

Change 906547 merged by Xqt:

[pywikibot/core@master] [bugfix] No longer lazy load cookies

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

Xqt claimed this task.

Change 908207 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@stable] [bugfix] No longer lazy load cookies

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

Change 908207 merged by Xqt:

[pywikibot/core@stable] [bugfix] No longer lazy load cookies

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