Page MenuHomePhabricator

Most CI sysop/write tests fails with UserRightsError
Closed, ResolvedPublic

Description

        elif right is not None and not self.has_right(right):
            raise UserRightsError('User "{}" does not have required '
                                  'user right "{}"'
>                                 .format(self.user(), right))
E           pywikibot.exceptions.UserRightsError: User "Pywikibot-oauth" does not have required user right "upload"

Possibly the user is not logged in.

Event Timeline

Xqt triaged this task as High priority.Apr 23 2024, 4:44 PM

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

[pywikibot/core@master] [tests] Show user rights if UserRightsError is raised during tests

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

Change #1023474 merged by jenkins-bot:

[pywikibot/core@master] [tests] Show user rights if UserRightsError is raised during tests

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

Xqt added a subscriber: Legoktm.

Pywikibot-oauth is in sysop group on wikipedia:test but obviously does not have sysop rights:
https://github.com/wikimedia/pywikibot/actions/runs/8860795896/job/24331964261

For tests we currently need the following rigts:

delete, flow-delete, flow-lock, mergehistory, patrol, protect, undelete, upload

The following right are missing for the account but anonymous users has them:

['centralauth-merge', 'createaccount', 'editmyoptions', 'editmyprivateinfo', 'urlshortener-create-url', 'viewmyprivateinfo']

The following rights are missing but "normal" (autoconfirmed) users have them:

['campaignevents-email-participants', 'campaignevents-enable-registration', 'campaignevents-organize-events', 'centralauth-merge', 'collectionsaveascommunitypage', 'collectionsaveasuserpage', 'createaccount', 'editmyoptions', 'editmyprivateinfo', 'editmyusercss', 'editmyuserjs', 'editmyuserjson', 'enrollasmentor', 'flow-lock', 'ipinfo', 'ipinfo-view-basic', 'lqt-merge', 'lqt-react', 'lqt-split', 'mwoauthmanagemygrants', 'pagelang', 'reupload', 'reupload-own', 'sendemail', 'spamblacklistlog', 'transcode-reset', 'transcode-status', 'translate-groupreview', 'translate-messagereview', 'upload', 'upload_by_url', 'urlshortener-create-url', 'viewmyprivateinfo']

@Legoktm: any idea?

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

[pywikibot/core@master] [tests] run write tests with Pywikibot-test account

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

Change #1024936 merged by Xqt:

[pywikibot/core@master] [tests] run write tests with Pywikibot-test account

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

JJMC89 subscribed.

With OAuth, the user will only have the rights that have been specified in the selected grants.

Thank you @JJMC89. Seems the best is to revoke sysop group from this account and grant it to the other test account.

Sorry about the delay, I've implemented the requested changes.

Thanks a lot @Legoktm; found a lot of bugs to be solved now

Xqt claimed this task.
Xqt reassigned this task from Xqt to Legoktm.