Hi,
To keep part of SuggestBot's data updated I have a script that polls regularly (once an hour) and uses the site.recentchanges() method to get a time-limited list of the recent changes. Lately I have noticed that this script throws an error:
raise APIError(code, info, **result["error"]) pywikibot.data.api.APIError: rcpermissiondenied: You need the patrol right to request the patrolled flag
From what I can tell by sending manual requests to en-WP's API, I
don't get this error message if I'm logged in (as a regular user), but it pops up if I'm not logged in. SuggestBot should be logged in, as I make calls to pywikibot.getSite() and site.has_right() before I call site.recentchanges(). So it could seem like the problem is related to not being logged in.
I'm not sure where to start debugging this, maybe it's not a pywikibot problem? Maybe it's only something I'm seeing? I'm running the latest revision of the rewrite branch, btw.
Any input on where to start looking for clues would be great, thanks!
Cheers, Morten
2012/3/20 Morten Wang nettrom@gmail.com
Lately I have noticed that this script throws an error:
raise APIError(code, info, **result["error"])
What does "lately" mean? Is there a coincidence with installation of MW 1.19?
On 20 March 2012 12:53, Bináris wikiposta@gmail.com wrote:
2012/3/20 Morten Wang nettrom@gmail.com
Lately I have noticed that this script throws an error:
raise APIError(code, info, **result["error"])
What does "lately" mean? Is there a coincidence with installation of MW 1.19?
In this case, "lately" means "since yesterday", which was when I first noticed the problem. It might be that it's related to MW 1.19, but I when I checked yesterday, all three Wikipedias that I poll (English, Swedish, and Norwegian) were running the same build of 1.19 (from what I could tell).
The first Wikipedia that threw this error was Norwegian. They were kind enough to quickly give the bot the patroller flag, and I haven't seen the error there since. Today I noticed the problem also occurring when polling English Wikipedia.
So I'm slightly confused about where to start looking for the problem, as the information I have so far does not make it very clear.
Cheers, Morten
This might not be related, but yesterday I also noticed a lot of unusual errors when editing with AutoWikiBrouser. See http://en.wikipedia.org/wiki/Wikipedia_talk:AutoWikiBrowser/Bugs#ApiXmlExcep... . I got about 5 of those in 2k images doing trivial edits that never before gave me any trouble.
Jarek
-----Original Message----- From: pywikipedia-l-bounces@lists.wikimedia.org [mailto:pywikipedia-l-bounces@lists.wikimedia.org] On Behalf Of Morten Wang Sent: Tuesday, March 20, 2012 2:15 PM To: Pywikipedia discussion list Subject: Re: [Pywikipedia-l] Recent changes,permission denied need patrol right
On 20 March 2012 12:53, Bináris wikiposta@gmail.com wrote:
2012/3/20 Morten Wang nettrom@gmail.com
Lately I have noticed that this script throws an error:
raise APIError(code, info, **result["error"])
What does "lately" mean? Is there a coincidence with installation of MW 1.19?
In this case, "lately" means "since yesterday", which was when I first noticed the problem. It might be that it's related to MW 1.19, but I when I checked yesterday, all three Wikipedias that I poll (English, Swedish, and Norwegian) were running the same build of 1.19 (from what I could tell).
The first Wikipedia that threw this error was Norwegian. They were kind enough to quickly give the bot the patroller flag, and I haven't seen the error there since. Today I noticed the problem also occurring when polling English Wikipedia.
So I'm slightly confused about where to start looking for the problem, as the information I have so far does not make it very clear.
Cheers, Morten
_______________________________________________ Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
I started a thread on wikitech-l to see on which side may the error be. Please look at http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/thread.html#59108... API behaviour") and see if you can give more details there.
---------- Forwarded message ---------- From: Mark A. Hershberger mah@wikimedia.org Date: 2012/3/21 Subject: [Wikitech-l] API Bug Triage on Friday To: wikitech-l@lists.wikimedia.org
What: API Bug Triage Where: #wikimedia-dev http://webchat.freenode.net/?channels=#wikimedia-dev When: 20:00UTC on Friday, March 23, 2012
Based on a few bug reports and discussion here, I think the time has come for an API bug triage. I've started a thread here: https://www.mediawiki.org/wiki/Project_talk:WikiProject_Bug_Squad
Hope to see you there!
Mark
I've finally found some more time to fiddle with this problem. The problem appears to be related to the fact that I'm using one script that grabs data from three different Wikipedias (English, Norwegian, and Swedish) with three different accounts[1]. Doing them in order the script correctly logs in to each one, and when it later returns to the first one it seems to think it's logged in. Looking at the cookie info I see that the centralAuth info is correct for the Swedish account, not for the English, and there are cookies for user ID and username for each of the three langauges. So if the script thinks it's logged in to English Wikipedia and sends the request, the API will correctly notice that the info isn't consistent and throw the error.
Is my reasoning correct here? Is there something I can do on my end to force a login every time, or should I instead write my scripts so they run separately for each account?
Footnotes: 1: Once upon a time it seemed like a great idea... 2: Need to be logged in to read the patrolled flag, from what I've been able to figure out.
Cheers, Morten
I still do not understand the relationship. interwiki.py operates on different sites too without having these problems.
Regards xqt
----- Original Nachricht ---- Von: Morten Wang nettrom@gmail.com An: Pywikipedia discussion list pywikipedia-l@lists.wikimedia.org Datum: 12.04.2012 22:17 Betreff: Re: [Pywikipedia-l] Recent changes, permission denied need patrol right
I've finally found some more time to fiddle with this problem. The problem appears to be related to the fact that I'm using one script that grabs data from three different Wikipedias (English, Norwegian, and Swedish) with three different accounts[1]. Doing them in order the script correctly logs in to each one, and when it later returns to the first one it seems to think it's logged in. Looking at the cookie info I see that the centralAuth info is correct for the Swedish account, not for the English, and there are cookies for user ID and username for each of the three langauges. So if the script thinks it's logged in to English Wikipedia and sends the request, the API will correctly notice that the info isn't consistent and throw the error.
Is my reasoning correct here? Is there something I can do on my end to force a login every time, or should I instead write my scripts so they run separately for each account?
Footnotes: 1: Once upon a time it seemed like a great idea... 2: Need to be logged in to read the patrolled flag, from what I've been able to figure out.
Cheers, Morten
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
It may help to obtain separate patrol tokens from each Wikipedia, and use those.
See patrol.py
On Fri, Apr 13, 2012 at 6:17 AM, Morten Wang nettrom@gmail.com wrote:
I've finally found some more time to fiddle with this problem. The problem appears to be related to the fact that I'm using one script that grabs data from three different Wikipedias (English, Norwegian, and Swedish) with three different accounts[1]. Doing them in order the script correctly logs in to each one, and when it later returns to the first one it seems to think it's logged in. Looking at the cookie info I see that the centralAuth info is correct for the Swedish account, not for the English, and there are cookies for user ID and username for each of the three langauges. So if the script thinks it's logged in to English Wikipedia and sends the request, the API will correctly notice that the info isn't consistent and throw the error.
Is my reasoning correct here? Is there something I can do on my end to force a login every time, or should I instead write my scripts so they run separately for each account?
Footnotes: 1: Once upon a time it seemed like a great idea... 2: Need to be logged in to read the patrolled flag, from what I've been able to figure out.
Cheers, Morten
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
pywikipedia-l@lists.wikimedia.org