After following https://www.mediawiki.org/wiki/Manual:Pywikibot/OAuth/Wikimedia:
On Toolforge, run:
tools.arambot@tools-sgebastion-10:~$ $HOME/pwbvenv/bin/python3 $HOME/pywikibot-core/pwb.py commonscat.py -family:wikipedia -lang:ckb -ns:0 -ns:14 -recentchanges
And as we see, it works a little bit (without any actions), but throws these error then:
Retrieving 50 pages from wikipedia:ckb. >>> پۆل:ڕەقەکان <<< Commonscat template is already on پۆل:ڕەقەکان WARNING: API error mwoauth-invalid-authorization-invalid-user: The authorization headers in your request are for a user that does not exist here 1 read operation Execution time: 1 seconds Read operation time: 1.0 seconds Script terminated by exception: ERROR: Failed OAuth authentication for commons:commons: The authorization headers in your request are for a user that does not exist here (NoUsernameError) Traceback (most recent call last): File "/data/project/arambot/pywikibot-core/pwb.py", line 39, in <module> sys.exit(main()) File "/data/project/arambot/pywikibot-core/pwb.py", line 35, in main runpy.run_path(str(path), run_name='__main__') File "/usr/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/data/project/arambot/pywikibot-core/pywikibot/scripts/wrapper.py", line 513, in <module> main() File "/data/project/arambot/pywikibot-core/pywikibot/scripts/wrapper.py", line 497, in main if not execute(): File "/data/project/arambot/pywikibot-core/pywikibot/scripts/wrapper.py", line 484, in execute run_python_file(filename, script_args, module) File "/data/project/arambot/pywikibot-core/pywikibot/scripts/wrapper.py", line 148, in run_python_file main_mod.__dict__) File "/data/project/arambot/pywikibot-core/scripts/commonscat.py", line 576, in <module> main() File "/data/project/arambot/pywikibot-core/scripts/commonscat.py", line 570, in main bot.run() File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/bot.py", line 1664, in run self.treat(page) File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/bot.py", line 1917, in treat self.treat_page() File "/data/project/arambot/pywikibot-core/scripts/commonscat.py", line 296, in treat_page currentCommonscatTarget) File "/data/project/arambot/pywikibot-core/scripts/commonscat.py", line 469, in checkCommonscatLink commonsSite = self.current_page.site.image_repository() File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/site/_apisite.py", line 1170, in image_repository return pywikibot.Site(code, fam, self.username()) File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/__init__.py", line 266, in Site _sites[key] = interface(code=code, fam=fam, user=user) File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/site/_datasite.py", line 38, in __init__ super().__init__(*args, **kwargs) File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/site/_apisite.py", line 127, in __init__ self.login(cookie_only=True) File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/site/_apisite.py", line 396, in login raise e File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/site/_apisite.py", line 387, in login if self.userinfo['name'] == self.user(): File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/site/_apisite.py", line 553, in userinfo uidata = uirequest.submit() File "/mnt/nfs/labstore-secondary-tools-project/arambot/pywikibot-core/pywikibot/data/api/_requests.py", line 1070, in submit raise NoUsernameError(f'Failed {msg}') pywikibot.exceptions.NoUsernameError: Failed OAuth authentication for commons:commons: The authorization headers in your request are for a user that does not exist here CRITICAL: Exiting due to uncaught exception NoUsernameError: Failed OAuth authentication for commons:commons: The authorization headers in your request are for a user that does not exist here
We don't take any action on https://commons.wikimedia.org using commonscat.py script and why we got these errors? I still added usernames['commons']['commons'] = 'AramBot', but got the same errors again.