Multichill created this task. Multichill added a subscriber: Multichill. Multichill added projects: pywikibot-core, Pywikibot-Wikidata.
TASK DESCRIPTION When running a bot I seem to run into this situation about once a day:
Adding instance claim to [[wikidata:Q592478]] Adding new reference claim to [[wikidata:Q592478]] ERROR: Detected MediaWiki API exception ReadOnlyError; retrying WARNING: Waiting 5 seconds before retrying. Traceback (most recent call last): File "C:\pywikibot\coredev\viaf_import.py", line 445, in <module> main() File "C:\pywikibot\coredev\viaf_import.py", line 440, in main viafBot.run() File "C:\pywikibot\coredev\viaf_import.py", line 85, in run self.addOtherRegistries(personItem, viafid, regdict) File "C:\pywikibot\coredev\viaf_import.py", line 104, in addOtherRegistries self.addViafReference(personItem, newclaim, viafid) File "C:\pywikibot\coredev\viaf_import.py", line 317, in addViafReference newclaim.addSources([refstated, refurl, refdate]) File "C:\pywikibot\coredev\pywikibot\page.py", line 3881, in addSources data = self.repo.editSource(self, claims, new=True, **kwargs) File "C:\pywikibot\coredev\pywikibot\site.py", line 987, in callee return fn(self, *args, **kwargs) File "C:\pywikibot\coredev\pywikibot\site.py", line 5369, in editSource data = req.submit() File "C:\pywikibot\coredev\pywikibot\data\api.py", line 1071, in submit raise APIError(code, info, **result["error"]) pywikibot.data.api.APIError: editconflict: Edit conflict. <class 'pywikibot.data.api.APIError'> CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
* Bot adds claim (no problem) * Bot adds reference * Runs into a ReadOnlyError * Tries again * Editconflict It's a bit weird because it looks like at https://www.wikidata.org/w/index.php?title=Q592478&action=history the reference was added in the first step.
I'll file another bug for the frequent MediaWiki switching to read-only problems. I also encountered that as a user.
TASK DETAIL https://phabricator.wikimedia.org/T85341
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Multichill Cc: Aklapper, Multichill, jayvdb, pywikipedia-bugs
Multichill added a comment.
Filed https://phabricator.wikimedia.org/T85342 for the read-only part.
TASK DETAIL https://phabricator.wikimedia.org/T85341
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Multichill Cc: Aklapper, Multichill, jayvdb, pywikipedia-bugs
jayvdb added a subscriber: jayvdb. jayvdb added a comment.
My immediate workaround is for you to revise your code to add the references as part of the same operation.
Use ItemPage.get(), then alter the ItemPage contents (i.e. add Claims directly to item.claims), and then save it with Page.editEntity() One editentities API call; one edit; no edit conflicts. See tests/wikibase_edit_tests.py test_edit_entity*
Also see https://gerrit.wikimedia.org/r/#/c/176934/ which makes it easier to add Claims to the ItemPage.
TASK DETAIL https://phabricator.wikimedia.org/T85341
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: Aklapper, Multichill, jayvdb, pywikipedia-bugs
jayvdb edited the task description. jayvdb set Security to none.
TASK DETAIL https://phabricator.wikimedia.org/T85341
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: Aklapper, Multichill, jayvdb, pywikipedia-bugs
Multichill added a comment.
As a "normal" user I had this also on the Dutch Wikipedia. Akoopal had the same and he managed to dig up the timestamp: 2014-12-21 22:51:46 akoopal : "Opgelet: De database is op dit moment wegens onderhoudswerkzaamheden geblokkeerd." This is the message we have at https://nl.wikipedia.org/wiki/MediaWiki:Readonlywarning
TASK DETAIL https://phabricator.wikimedia.org/T85341
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Multichill Cc: Aklapper, Multichill, jayvdb, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org