New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MediaWiki::Bot fails to log in #77
Comments
When you say "manually logging in" do you mean calling the login method Offhand, I don't know what the issue is. t/02-login.t and t/04-edit.t both On Tue, Dec 8, 2015 at 1:35 PM, Cthulhux notifications@github.com wrote:
|
Manually is over my web browser, yes. I'm confused. |
Can I somehow help you track down the problem? |
MediaWiki software changed login procedures. My bot has been dead ever since the change. See https://lists.wikimedia.org/pipermail/wikitech-l/2016-January/084501.html |
I'm now spending zero time on non-maintainer tasks. Please feel free to fix On Fri, Feb 19, 2016 at 11:08 AM, bgwhite notifications@github.com wrote:
|
That's bad news. :( @bgwhite Do you have some time for that? |
I do have time. More importantly, I haven't a clue about cookie jars and Bryan On Fri, Feb 19, 2016 at 3:28 PM, Cthulhux notifications@github.com wrote:
|
|
I'm facing the same problem... :( About this issue as @doherty said: "[...]I'm not doing development work on this project any longer.[...]". No one will submit pull request? If no, can anybody suggest another library that is actively maintained? |
I guess there is none. So the only chance is to fork this and fix the issue. |
If you're going to write a patch, just submit it here. I'm perfectly happy to accept patches and do releases. |
I'm trying to help but I'm not getting some things... (let me known if there is a forum that we can talk about this module) I'm starting to learn Perl but I could see that your code is based on MediaWiki::API, and I don't known why but the basic login sub works fine. Could you list please the features your login has that the other don't? Brad Jorsch (Anomie) said: I just don't see in the code where is the "manual handling" (its not handled automatically by LWP module?)... |
I still don't get the problem. I'm using MediaWiki::Bot v5.005006 (with MediaWiki::API v0.39 and LWP:UserAgent v6.05) at wmlabs without any login trouble at de.wikipedia.org. Which version do you use? |
I can't log in on |
are you able to login if you use the versions I mentioned? |
No success with MediaWiki::Bot v5.005006 and MediaWiki::API v0.39. Sadly, LWP::UserAgent v6.05 is 404 everywhere, so I'm stuck with the newest CPAN build. |
MediaWiki 1.27 was recently released to the general public. According to the API documents, the login API has changed in this release: https://www.mediawiki.org/wiki/API:Login#How_to_log_in I have a bot which maintains parts of the snpedia.com wiki. It was just upgraded to MediaWiki 1.27. Since then my bots have been unable to login. Functions which do not require authentication continue to work correctly. The code which no longer works is: $bot=MediaWiki::Bot->new({ $bot->login({ The errors are: Error code 2: 500 Internal Server Error : error occurred when accessing https://bots.snpedia.com/api.php after 6 attempt(s) at /Desktop/DNA/bin/snpediapop.pl line 102. The relevant modules are up to date as per what is in CPAN: cpan[2]> install MediaWiki::API cpan[3]> install MediaWiki::Bot cpan[4]> install LWP:UserAgent As this release also triggered end of support for MediaWiki 1.25, you may see a larger than usual number of people upgrading to the new version. |
As of 1.27, the login action should only be used in combination with bot passwords, and clientlogin should be used by interactive applications. Login#How_to_log_in I tested this new feature called "bot passwords" (just login your account and create a bot password here) and seems its working except that _is_loggedin is not working right. With my new account (username Guiwp@Wik) it says:
Guiwp != Guiwp@Wik |
Thanks, guiwp, You solved my problem, or at least set me on the right path. The Special:BotPasswords page seems to be specific to wikipedia foundation sites. From: http://permalink.gmane.org/gmane.science.linguistics.wikipedia.technical/85415 "If you need to continue using the existing action=login, ... go to Special:BotPasswords, set [a bot password] up, and then use new bot-password username and password to login as you've always done (no code changes, just update your bot's configuration)." But Special:BotPasswords didn't work on the private wiki I use, and it goes on to explain: "For bots that run on third-party wikis, Bot Passwords are in core and are enabled by default." This is about as clear as mud. I logged in on the web as my bot and poked around preferences for a bit, and got nowhere trying to find some place to set a bot password. Then on a whim I decided to change my bot's regular login password. Suddenly my bot script could log in again. Changing the password accomplished whatever magic was required. So the complete solution is: On wikipedia foundation sites, go to the Special:BotPasswords page. Edited to add: There seem to still be some issues. My bot stops working after a few transactions with "Error code 2: 500 Internal Server Error : error occurred when accessing https://bots.snpedia.com/api.php after 6 attempt(s)" errors, but at least this fixes logins. ETA2: The above errors were due to a server error. After the server problem was fixed, the bot is running again with no errors. |
Hmm - so I gave my bot a bot password and changed the password to the one the particular page told me - still the same problem :( |
Have you tried instead of setting username and password in login_data to use $wikibot->login as in my example? |
That leaves me with "Login failed.". :-( |
oAuth is complicated, so supporting bot passwords is the easiest way forward. See the added POD for detail. Related documentation: - https://www.mediawiki.org/wiki/API:Login - https://www.mediawiki.org/wiki/API:Tokens - https://www.mediawiki.org/wiki/API:Userinfo - https://www.mediawiki.org/wiki/Manual:Bot_passwords - https://lists.wikimedia.org/pipermail/wikitech-l/2016-January/084501.html Fixes gh-80, gh-77
Should be fixed by 884f07d |
Hmm, I still get "Login failed. at ./recherchebot.pl line 52". Here's my code (line 52 ff):
|
When you created the bot password, you gave it a name. You should login
|
Good point, thanks. Corrected it, but I still get Login failed with |
Here I don't see any problem, it's working right. Maybe you mistyped something. |
Ah, yes - indeed. My "read from a password file" function didn't work as expected. Thank you, it works now! |
Glad to hear it
|
A few weeks ago,
MediaWiki::Bot
suddenly stopped to be able to log in.Here's what I try:
Well:
Line 41 is the one starting with
my $wikibot
.Manually logging in as RechercheBot (which is a valid, not restricted account) with the supplied settings, however, works well. Do you have a clue?
The text was updated successfully, but these errors were encountered: