Skip to content
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-1.25 API incompatibility #69

Open
GreyCat opened this issue Oct 9, 2014 · 9 comments
Open

mediawiki-1.25 API incompatibility #69

GreyCat opened this issue Oct 9, 2014 · 9 comments

Comments

@GreyCat
Copy link
Contributor

GreyCat commented Oct 9, 2014

I have a mediawiki-gateway based bot that I'd like to run on http://ru.wikipedia.org/ - last time I tried it on about ~2013-12, and it was ok back then, but nowadays I always get the following error:

D, [2014-10-09T08:05:41.453869 #30170] DEBUG -- : GET:
{"action"=>"query", "prop"=>"info", "intoken"=>"edit",
"titles"=>"User:WebAnalyticsBot/testing", "format"=>"xml",
"maxlag"=>5}, {"ruwikiSession"=>"466dfb2ce72418b74400629b25975cc0",
"GeoIP"=>"RU%3AMoscow%3A55.7522%3A37.6156%3Av4", "Path"=>"%2F",
"Domain"=>".wikipedia.org", "centralauth_User"=>"WebAnalyticsBot",
"domain"=>".wikipedia.org", "centralauth_Token"=>"...",
"centralauth_Session"=>"...", "forceHTTPS"=>"true",
"ruwikiUserID"=>"1084957", "ruwikiUserName"=>"WebAnalyticsBot"}

D, [2014-10-09T08:05:41.741127 #30170] DEBUG -- : RES:
<api><warnings><info xml:space='preserve'>The intoken parameter has
been deprecated.</info></warnings><query><normalized><n
from='User:WebAnalyticsBot/testing'
to='User:WebAnalyticsBot/testing'/></normalized><pages><page
contentmodel='wikitext' counter=''
edittoken='a03becb45126ea2136e40e3f7cc2e1e2+\' lastrevid='60065217'
length='2' ns='2' pageid='4652026' pagelanguage='ru'
starttimestamp='2014-10-09T04:05:41Z'
title='User:WebAnalyticsBot/testing'
touched='2013-12-12T18:01:51Z'/></pages></query></api>

/var/lib/gems/2.1.0/gems/mediawiki-gateway-0.6.2/lib/media_wiki/gateway.rb:1071:in
`warning': API error: code 'warning', info 'API warning: The intoken
parameter has been deprecated.' (MediaWiki::APIError)

Basically, it seems that mediawiki-gateway tries to use
action=query&prop=info&intoken=edit stuff, which seems to be
deprecated now
:

* prop=info (in) *
  Get basic page information such as namespace, title, last touched date, ...
  https://www.mediawiki.org/wiki/API:Properties#info_.2F_in
[...]
  intoken             - DEPRECATED! Request a token to perform a data-modifying action on a page

It's probably a fairly vital issue, as it makes mediawiki-gateway totally unusable in current Wikipedia's installation environments, at least out of the box.

As far as I understand, it's not necessary to request a token, it would be given out automatically anyway in modern Mediawiki installations - probably this could be simply fixed by removing intoken= setting.

@GreyCat
Copy link
Contributor Author

GreyCat commented Oct 9, 2014

@blackwinter suggested to try ignoring warnings by :ignorewarnings => true in MediaWiki::Gateway.new - I confirm that it works around the issue.

@blackwinter
Copy link
Collaborator

Thanks for filing this issue.

For the record: The MediaWiki version used by Wikipedia (currently 1.25wmf1) is bleeding edge and not publicly released yet. The underlying change, however, has even greater ramifications (wikimedia/mediawiki@fdddf94) and will be released in 1.24, scheduled for next month.

@GreyCat
Copy link
Contributor Author

GreyCat commented Oct 9, 2014

Thanks for checking the Mediawiki version history for me. Wow, I never thought that Wikipedia devops are so bold to live off the bleeding edge in production %)

@jpatokal
Copy link
Owner

For better or worse, MediaWiki is Wikipedia, and they've been running those unreleased "wmf" versions for years.

@blackwinter
Copy link
Collaborator

Related to #76.

@jaredbeck
Copy link

@blackwinter suggested to try ignoring warnings by :ignorewarnings => true in MediaWiki::Gateway.new - I confirm that it works around the issue.

Is it still necessary to use this workaround?

@jaredbeck
Copy link

Here's another warning from MW 1.25, raised by MediaWiki::Gateway::Users#options.

MediaWiki::APIError: API error: code 'warning', info 'API warning: action=tokens has been deprecated. Please use action=query&meta=tokens instead.'

@jpatokal
Copy link
Owner

jpatokal commented Jan 4, 2016

This is not going to get fixed unless somebody sends in a pull request.

Also, given that WMF has now released an "official" client at https://github.com/wikimedia/mediawiki-ruby-api, I will likely be deprecating this library entirely soon.

@jaredbeck
Copy link

.. given that WMF has now released an "official" client .. I will likely be deprecating this library entirely ..

Makes sense, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants