Krinkle added a comment.

This change broke KrinkleBot on Wikimedia Commons. File protection synchronisation was down for 13 hours. I last re-installed KrinkleBot 3 months ago in July. Using the then-latest version of Pywikibot core. It ran mostly uninterrupted – until yesterday. It started failing at 2016-10-12 19:17:10.

fileprotectionsync.err
[..]
Sleeping for 9.5 seconds, 2016-10-12 11:01:52
Page [[Commons:Auto-protected files/wikipedia/fr]] saved

WARNING: API error maxlag: Waiting for 10.64.48.150: 6.2437400817871 seconds lagged
Traceback (most recent call last): [..]
CRITICAL: Closing network session.

Logging in to commons:commons as KrinkleBot@Autoprotect
Sleeping for 7.4 seconds, 2016-10-12 11:16:09
Page [[Commons:Auto-protected files/wikipedia/de]] saved
[..]
Sleeping for 9.3 seconds, 2016-10-12 19:17:10
Page [[Commons:Auto-protected files/wikipedia/bn]] saved
Logging in to commons:commons as KrinkleBot@Autoprotect

Traceback (most recent call last): [..]
    if loginMan.login(retry=True):
    cookiedata = self.getCookie()
    prefix = login_result['login']['cookieprefix']
KeyError: u'cookieprefix'
CRITICAL: Closing network session.

In attempt to remedy this, I updated the copy of pywikibot-core from Git and re-ran python setup.py. The next run failed with a different error:

fileprotectionsync.err
    token = self.tokens['edit']
    assert self.site.user(), 'User must login in this site'
AssertionError: User must login in this site
CRITICAL: Closing network session.

I suspected this may be due to a breaking in bot passwords handling. The following configuration used to work:

.pwd
("Username@Botname", "<bot password>")
user-config.py
import os
family = 'commons'
mylang = 'commons'
usernames['commons']['commons'] = u'Username@Botname'
sysopnames['commons']['commons'] = u'Username@Botname'
password_file = os.path.expanduser('~/.pywikibot/.pwd')

Per https://www.mediawiki.org/wiki/Manual:Pywikibot/BotPasswords I changed this to use plain "Username" and create a BotPassword() object in the password file.

.pwd
("Username", BotPassword("Botname", "<bot password>"))
user-config.py
usernames['commons']['commons'] = u'Username'
sysopnames['commons']['commons'] = u'Username'

This fixed it.


TASK DETAIL
https://phabricator.wikimedia.org/T142155

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Legoktm, Krinkle
Cc: Krinkle, MZMcBride, Jay8g, revi, Paladox, Aschroet, zhuyifei1999, Stashbot, gerritbot, DrTrigon, Betacommand, Lokal_Profil, Tgr, Legoktm, JJMC89, Yamaha5, jayvdb, Ladsgroup, Xqt, valhallasw, Multichill, Anomie, CodeCat, TerraCodes, Luke081515, He7d3r, Basilicofresco, Jagwar, MarcoAurelio, Dalba, Aklapper, Joutbis, pywikibot-bugs-list, MayS, Mdupont, Alchimista
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to