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.

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 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 The next run failed with a different error:

    token = self.tokens['edit']
    assert, '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:

("Username@Botname", "<bot password>")
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 I changed this to use plain "Username" and create a BotPassword() object in the password file.

("Username", BotPassword("Botname", "<bot password>"))
usernames['commons']['commons'] = u'Username'
sysopnames['commons']['commons'] = u'Username'

This fixed it.



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

Reply via email to