JJMC89 created this task.
JJMC89 added projects: Pywikibot-core, Pywikibot-touch.py.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION

Touch.py should not crash on APIError: readonly. It would be preferable to wait for the database to become unlagged and then retry.

WARNING: API error readonly: The database has been automatically locked while the slave database servers catch up to the master
...
Script terminated by exception:

ERROR: APIError: readonly: The database has been automatically locked while the slave database servers catch up to the master [readonlyreason:Waiting for 5 lagged database(s); help:See https://en.wikipedia.org/w/api.php for API usage.]
Traceback (most recent call last):
  File "/shared/pywikipedia/core/scripts/touch.py", line 113, in <module>
    main()
  File "/shared/pywikipedia/core/scripts/touch.py", line 105, in main
    bot.run()
  File "/shared/pywikipedia/core/pywikibot/bot.py", line 1621, in run
    super(MultipleSitesBot, self).run()
  File "/shared/pywikipedia/core/pywikibot/bot.py", line 1435, in run
    self.treat(page)
  File "/shared/pywikipedia/core/scripts/touch.py", line 70, in treat
    "" if page.purge() else " not"))
  File "/shared/pywikipedia/core/pywikibot/page.py", line 1338, in purge
    return self.site.purgepages([self], **kwargs)
  File "/shared/pywikipedia/core/pywikibot/site.py", line 1330, in callee
    return fn(self, *args, **kwargs)
  File "/shared/pywikipedia/core/pywikibot/site.py", line 5762, in purgepages
    result = req.submit()
  File "/shared/pywikipedia/core/pywikibot/data/api.py", line 2189, in submit
    raise APIError(**result['error'])
pywikibot.data.api.APIError: readonly: The database has been automatically locked while the slave database servers catch up to the master [readonlyreason:Waiting for 5 lagged database(s); help:See https://en.wikipedia.org/w/api.php for API usage.]
CRITICAL: Closing network session.
Pywikibot: [https] r-pywikibot-core.git (efbc8b1, g1, 2016/12/23, 21:24:16, n/a)
Release version: 3.0-dev
requests version: 2.2.1
  cacerts: /etc/ssl/certs/ca-certificates.crt
    certificate test: ok
Python: 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4]

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

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

To: JJMC89
Cc: Aklapper, pywikibot-bugs-list, JJMC89, Magul, Tbscho, MayS, Mdupont, Avicennasis, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to