Page MenuHomePhabricator

Manage temporary readonly error
Closed, ResolvedPublic

Description

Meet with different scripts. PWB should retry after a minute.

WARNING: API error readonly: The database has been automatically locked while the slave database servers catch up to the master
Traceback (most recent call last):
...
 File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/page.py", line 1235, in _save
    raise pywikibot.OtherPageSaveError(self, err)
pywikibot.exceptions.OtherPageSaveError: Edit to page [[Huang Bokai]] failed:
readonly: The database has been automatically locked while the slave database servers catch up to the master [readonlyreason:Waiting for 3 lagged database(s); help:See https://fr.wikipedia.org/w/api.php for $CRITICAL:  Closing network session.

Event Timeline

Wait no.. the MediaWiki code for this is hard to deal with:

So two API errors seem to be generated, and both seem to lack some unique identifier.

Thanks @zhuyifei1999 for investigation.

On my error log above, I have the output WARNING: API error readonly: xxxxx, so that correspond to this.
It's look like the API error named internal_api_error_ReadOnlyError was renamed to readonly. So, in api.py, code.startswith(u'internal_api_error_') is not enabled (T61227).

I'll edit the code to accept readonly as an error that need edit retry

Change 333033 had a related patch set uploaded (by Gerrit Patch Uploader):
[bugfix] Menage temporary readonly error

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

Framawiki renamed this task from Menage temporary readonly error to Manage temporary readonly error.May 10 2017, 7:22 AM

Change 333033 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Manage temporary readonly error

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

Multichill subscribed.

Patch merged, should be fixed. Fire up some bots to see if it works!

Left several bots running for the night. If these are still running tomorrow or finished without crashing on a readonly error, I'll close this one.