Page MenuHomePhabricator

Requests global account tokens on all wikis
Closed, ResolvedPublic

Description

THe bot requests tokens which concern only wikis with global accounts (like the WMF wiki). It appears that wikis which don't have such a system don't use the following tokens: setglobalaccountstatus, deleteglobalaccount, centralauth

This results in the following warning, because it requests all tokens for that version at once:

WARNING: API warning (tokens): Unrecognized values for parameter 'type': setglobalaccountstatus, deleteglobalaccount, centralauth

Version: core-(2.0)
Severity: trivial

Details

Reference
bz70965

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:51 AM
bzimport set Reference to bz70965.
bzimport added a subscriber: Unknown Object (????).
XZise created this task.Sep 17 2014, 10:03 PM
XZise added a subscriber: jayvdb.Jan 2 2015, 9:42 PM

With @jayvdb's patch to get easily the param info it's possible to get most of the allowed tokens dynamically. There is some problem with the patrol token which isn't get via the prop=info but list=recentchanges module.

Nemo_bis added a subscriber: Nemo_bis.EditedJan 10 2015, 1:57 PM

I'm seeing this error as well on translatewiki.net. I'm using latest pwb master.

This is probably the reason my bot isn't managing to save a single edit? No, ignore me, it was my fault.

XZise added a comment.Jan 10 2015, 2:38 PM

Okay… Well for me it still works (just get a warning that those tokens don't exist). But I guess you already answered yourself, maybe you should make clearer that the second line is basically a new comment ;)

I am able to replicate it in a local mediawiki installation and am trying to solve it.
Those tokens are hard coded in TOKENS_1 (as suggested in T85725 ) in site.py and commenting them out from the set temporarily resolves the problem. As per my understanding, these tokens are required only when the Central Auth Extension is installed, as the corresponding API methods belong to this extension. So, I'm now trying to find a way to check whether the extension is installed and then modify TOKENS_1 accordingly. Am I on the right path and is there any simple way to do so ?

Well as said in T85725 you could query the paraminfo and just request all of those which are listed there. It should list those mentioned above when the extension is installed.

Nemo_bis removed a subscriber: Nemo_bis.Mar 12 2015, 6:17 PM

Change 196450 had a related patch set uploaded (by Akashagarwal):
Verifies tokens from paraminfo

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

akashagarwal added a comment.EditedMar 12 2015, 9:57 PM

Trying to make my first contribution to mediawiki and pywikibot. Although, I tried to follow all steps, not sure if I have done everything correctly. Please help me if there are any issues with it.

Change 196450 had a related patch set uploaded (by Akashagarwal):
Verifies tokens from paraminfo

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

Change 196450 merged by jenkins-bot:
Verifies tokens from paraminfo

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

jayvdb closed this task as Resolved.Mar 20 2015, 2:02 AM