XZise added a subscriber: XZise.
XZise added a comment.
I'm wondering if we should ditch the token cache. They are only valid for a certain time (which we probably can't determine from the outside) and we also don't handle different sysop and non-sysop tokens (though if we ditch that difference as well this is not such of a big concern).
TASK DETAIL
https://phabricator.wikimedia.org/T61678
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: XZise
Cc: XZise, Sitic, Qgil, Daniel_Mietchen, jayvdb, valhallasw, Ricordisamoa, 555, Multichill, Ladsgroup, pywikipedia-bugs
Qgil created this task.
Qgil added a subscriber: Qgil.
Qgil added projects: Project-Creators, dev.wikimedia.org, Engineering-Community, MediaWiki-Documentation, Pywikibot-documentation.
TASK DESCRIPTION
* Project name: Documentation
* Description: A tag to identify tasks requiring technical documentation. See also [[ https://www.mediawiki.org/wiki/Documentation | mw:Documentation ]].
* Type: Tag
* Policy: Default
The tracking bug {T2001} has been the way to collect bugs related with technical documentation. Now that a technical writer is about to join the #Engineering-Community team (T565), it is a good time to add a bit more of sophistication for better planning.
Note also that #mediawiki-documentation and #pywikibot-documentation (a tag?) exist as well.
Then there is #dev.wikimedia.org, but this is a documentation project on its own.
TASK DETAIL
https://phabricator.wikimedia.org/T85485
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: Qgil
Cc: Aklapper, Qgil, Gryllida, Jdforrester-WMF, Rfarrand, pywikipedia-bugs
Sitic added a comment.
Mentioning here for reference, the recent change seems to have caused T89702: Edits fail with "badtoken: Invalid token" after script runs for a while <https://phabricator.wikimedia.org/T89702>.
Village pump (technical)#How long does it take for a session timeout? <https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technica…>:
> The test fetching the edit token at the beginning and end of the run should certainly have not given you the same token each time; even fetching two tokens one second apart should give you two different tokens (but both valid) since the end of October. Since you got the same token hours apart, whatever you're using to fetch the tokens is apparently caching them rather than fetching a new one the second time.
> Ideally, your bot should be able to attempt the edit, and if it gets a badtoken error it should automatically fetch a fresh token and retry the edit.
> As for the time it takes, the configuration is currently using the default of 1 hour for $wgObjectCacheSessionExpiry. I don't see any recent changes to the timeout, but I do see there was this recent change to session handling that probably made page views no longer reset the session timer. Anomieâš” 13:05, 3 March 2015 (UTC)
TASK DETAIL
https://phabricator.wikimedia.org/T61678
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: Sitic
Cc: Sitic, Qgil, Daniel_Mietchen, jayvdb, valhallasw, Ricordisamoa, 555, Multichill, Ladsgroup, pywikipedia-bugs
Sitic created this task.
Sitic added a subscriber: Sitic.
Sitic added a project: pywikibot-core.
Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION
I'm maintaining a continuous running script, which resets the sandbox on dewiki (the sandbox on dewiki is a bit different to the ones on e.g. enwiki, it's a specialized script, not the reset_sandbox one).
It's been running without problems for several months, but suddenly since 12. February I only get "badtoken: Invalid token" exceptions when trying to save a page. When restarting it runs fine for a while, and then only gets "badtoken: Invalid token" on page.save.
Here is an example from the log
```
2015-02-17 10:43:39 Rahu.py, 182 in reset_sandbox: INFO {lightyellow}17. February 2015, 10:43:39: Reseting Sandbox ...{default}
2015-02-17 10:43:39 login.py, 205 in login: INFO Logging in to wikipedia:de as AsuraBot
2015-02-17 10:43:40 login.py, 223 in login: VERBOSE Should be logged in now
2015-02-17 10:43:40 throttle.py, 247 in wait: INFO Sleeping for 7.0 seconds, 2015-02-17 10:43:40
2015-02-17 10:43:48 api.py, 1314 in submit: VERBOSE API Error: query=
{'action': [u'edit'],
'assert': [u'user'],
'basetimestamp': [Timestamp(2015, 2, 17, 9, 22, 18)],
'bot': [True],
'createonly': [False],
'format': ['json'],
'maxlag': ['5'],
'minor': [False],
'nocreate': [False],
'notminor': [False],
'recreate': [True],
'summary': [u'[[WP:Bots', u'Bot]]: Spielwiese gem\xe4ht (zur\xfcckgesetzt)'],
'text': [u'{{Bitte erst NACH dieser Zeile schreiben! (Begr\xfc\xdfungskasten)}}\n{{subst:Vorlage:Bitte erst NACH dieser Zeile schreiben! (Begr\xfc\xdfungskasten)/Text}}'],
'title': [u'Wikipedia:Spielwiese'],
'token': [u'6c367b3d3ec08fed211b51859359f8d054e263f0+\\']}
2015-02-17 10:43:48 api.py, 1316 in submit: VERBOSE response=
{u'servedby': u'mw1190', u'error': {'help': u'See https://de.wikipedia.org/w/api.php for API usage'}}
2015-02-17 10:43:48 page.py, 1056 in _save: VERBOSE Error saving page [[Wikipedia:Spielwiese]] (badtoken: Invalid token)
Traceback (most recent call last):
File "/shared/pywikipedia/core/pywikibot/page.py", line 1047, in _save
watch=watchval, bot=botflag, **kwargs)
File "/shared/pywikipedia/core/pywikibot/site.py", line 1041, in callee
return fn(self, *args, **kwargs)
File "/shared/pywikipedia/core/pywikibot/site.py", line 4048, in editpage
result = req.submit()
File "/shared/pywikipedia/core/pywikibot/data/api.py", line 1318, in submit
raise APIError(code, info, **result["error"])
APIError: badtoken: Invalid token
2015-02-17 10:43:48 Rahu.py, 195 in reset_sandbox: INFO {lightyellow}Edit to page [[Wikipedia:Spielwiese]] failed:
badtoken: Invalid token while reseting!{default}
2015-02-17 10:43:49 Rahu.py, 182 in reset_sandbox: INFO {lightyellow}17. February 2015, 10:43:49: Reseting Sandbox ...{default}
2015-02-17 10:43:49 login.py, 205 in login: INFO Logging in to wikipedia:de as AsuraBot
2015-02-17 10:43:50 login.py, 223 in login: VERBOSE Should be logged in now
2015-02-17 10:43:50 throttle.py, 247 in wait: INFO Sleeping for 7.5 seconds, 2015-02-17 10:43:50
2015-02-17 10:43:58 api.py, 1314 in submit: VERBOSE API Error: query=
{'action': [u'edit'],
'assert': [u'user'],
'basetimestamp': [Timestamp(2015, 2, 17, 9, 22, 18)],
'bot': [True],
'createonly': [False],
'format': ['json'],
'maxlag': ['5'],
'minor': [False],
'nocreate': [False],
'notminor': [False],
'recreate': [True],
'summary': [u'[[WP:Bots', u'Bot]]: Spielwiese gem\xe4ht (zur\xfcckgesetzt)'],
'text': [u'{{Bitte erst NACH dieser Zeile schreiben! (Begr\xfc\xdfungskasten)}}\n{{subst:Vorlage:Bitte erst NACH dieser Zeile schreiben! (Begr\xfc\xdfungskasten)/Text}}'],
'title': [u'Wikipedia:Spielwiese'],
'token': [u'6c367b3d3ec08fed211b51859359f8d054e263f0+\\']}
2015-02-17 10:43:58 api.py, 1316 in submit: VERBOSE response=
{u'servedby': u'mw1139', u'error': {'help': u'See https://de.wikipedia.org/w/api.php for API usage'}}
2015-02-17 10:43:58 page.py, 1056 in _save: VERBOSE Error saving page [[Wikipedia:Spielwiese]] (badtoken: Invalid token)
Traceback (most recent call last):
File "/shared/pywikipedia/core/pywikibot/page.py", line 1047, in _save
watch=watchval, bot=botflag, **kwargs)
File "/shared/pywikipedia/core/pywikibot/site.py", line 1041, in callee
return fn(self, *args, **kwargs)
File "/shared/pywikipedia/core/pywikibot/site.py", line 4048, in editpage
result = req.submit()
File "/shared/pywikipedia/core/pywikibot/data/api.py", line 1318, in submit
raise APIError(code, info, **result["error"])
APIError: badtoken: Invalid token
2015-02-17 10:43:58 Rahu.py, 195 in reset_sandbox: INFO {lightyellow}Edit to page [[Wikipedia:Spielwiese]] failed:
badtoken: Invalid token while reseting!{default}
2015-02-17 10:44:01 Rahu.py, 182 in reset_sandbox: INFO {lightyellow}17. February 2015, 10:44:01: Reseting Sandbox ...{default}
2015-02-17 10:44:01 login.py, 205 in login: INFO Logging in to wikipedia:de as AsuraBot
2015-02-17 10:44:02 login.py, 223 in login: VERBOSE Should be logged in now
2015-02-17 10:44:03 throttle.py, 247 in wait: INFO Sleeping for 4.9 seconds, 2015-02-17 10:44:03
2015-02-17 10:44:08 api.py, 1314 in submit: VERBOSE API Error: query=
{'action': [u'edit'],
'assert': [u'user'],
'basetimestamp': [Timestamp(2015, 2, 17, 9, 22, 18)],
'bot': [True],
'createonly': [False],
'format': ['json'],
'maxlag': ['5'],
'minor': [False],
'nocreate': [False],
'notminor': [False],
'recreate': [True],
'summary': [u'[[WP:Bots', u'Bot]]: Spielwiese gem\xe4ht (zur\xfcckgesetzt)'],
'text': [u'{{Bitte erst NACH dieser Zeile schreiben! (Begr\xfc\xdfungskasten)}}\n{{subst:Vorlage:Bitte erst NACH dieser Zeile schreiben! (Begr\xfc\xdfungskasten)/Text}}'],
'title': [u'Wikipedia:Spielwiese'],
'token': [u'6c367b3d3ec08fed211b51859359f8d054e263f0+\\']}
2015-02-17 10:44:08 api.py, 1316 in submit: VERBOSE response=
{u'servedby': u'mw1228', u'error': {'help': u'See https://de.wikipedia.org/w/api.php for API usage'}}
2015-02-17 10:44:08 page.py, 1056 in _save: VERBOSE Error saving page [[Wikipedia:Spielwiese]] (badtoken: Invalid token)
Traceback (most recent call last):
File "/shared/pywikipedia/core/pywikibot/page.py", line 1047, in _save
watch=watchval, bot=botflag, **kwargs)
File "/shared/pywikipedia/core/pywikibot/site.py", line 1041, in callee
return fn(self, *args, **kwargs)
File "/shared/pywikipedia/core/pywikibot/site.py", line 4048, in editpage
result = req.submit()
File "/shared/pywikipedia/core/pywikibot/data/api.py", line 1318, in submit
raise APIError(code, info, **result["error"])
APIError: badtoken: Invalid token
```
Why is the token always the same? The relevant part of the script:
```
def reset_sandbox()
site = pywikibot.Site()
site.login()
sandboxPage = pywikibot.Page(site, sandboxTitle)
sandboxPage.get(force=True, get_redirect=True)
sandboxPage.text = sandboxDefault
sandboxPage.save(comment=comment, botflag=botflag, minor=False)
```
I previously used a shared site object, which causes the same errors.
TASK DETAIL
https://phabricator.wikimedia.org/T89702
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: Sitic
Cc: pywikipedia-bugs, Aklapper, Sitic, jayvdb
Aklapper added a project: Pywikibot-General.
Aklapper added a comment.
Herald added a subscriber: pywikipedia-bugs.
[Please associate projects when creating tasks, via the "Projects" field. Thanks!]
TASK DETAIL
https://phabricator.wikimedia.org/T91375
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: Aklapper
Cc: pywikipedia-bugs, Xqt, Aklapper
Chad closed blocking task T75164: Remove Anexo namespace from Portuguese Wikipedia as "Resolved".
TASK DETAIL
https://phabricator.wikimedia.org/T75170
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: Chad
Cc: valhallasw, Nemo_bis, He7d3r, jayvdb, Multichill, XZise, pywikipedia-bugs