Page MenuHomePhabricator

SvgTranslate tool fails during OAuth callback
Closed, DeclinedPublic


The SvgTranslate tool accepts translations, but when trying to save them, using OAuth, the following message is shown:

Error retrieving token: mwoauthdatastore-bad-token

stdClass Object ( [error] => mwoauthdatastore-bad-token [message] => No token was found matching your request. )

Event Timeline

Excessive warnings fixed in

Actual oAuth error has me stumped though -- was working in January


I ran SVGTranslate on [[File:Planetary transit.svg]] and keyed in some bogus translations.

I clicked OAuth upload, and got the expected redirect asking for authorization.

That should mean the temporary request token (oauth_token) and a secret were supplied to SVGTranslate over HTTPS.

I authorized the application and was redirected to

This redirect is WMF saying everything worked so far. My OAuth authorizations show SVGTranslate 1.0 is now authorized. The URL reveals the temporary oauth_token provided to SVGTranslate was &oauth_token=9b02d6b86d570858f07a1ee46f246de0. Meta likes that token.

SVGTranslate is supposed to take this information and acquire an access token from a third endpoint, Special:OAuth/token.

SVGTranslate blows up communicating with that endpoint:

Error retrieving token: mwoauthdatastore-bad-token
stdClass Object ( [error] => mwoauthdatastore-bad-token [message] => No token was found matching your request. )

Note that the redirect supplied &oauth_token=9b02d6b86d570858f07a1ee46f246de0 but the SVGTranslate request to the Special:Oauth/token endpoint used &oauth_token=5e4223de67b2a68a17808ee1c558d87c. I do not know where this second value came from. The oauth_verifier parameter was correctly copied, but not the oauth_token.

That would explain meta complaining about a bad/unknown token. Maybe a wrong argument is passed to a library function for oauth_token and meta didn't previously check if the token matched but keyed only on the oauth_verifier. Maybe the session information gets confused and the oauth_token is pulled from a different session.

Other tools may have had similar trouble:

Tried to do manual upload, but had problems.

Browser asked me what to do. I clicked save, and it hung.

Tried again with save-as, and it hung. It created an empty desired file and an empty .partial file.

Tried again with open, and it displayed the desired SVG in my browser, but the file has an XXX (2).svg name and 2 .partial files in the directory,

So it looks like I could run SVGTranslate, do a manual upload, and click open. That gets me the bits. Then I would need to use that deep filename or save the file to a more reasonable location. Then I could go to commons and upload the file.

Hmm, it might be that the redirect url is HTTP but the consumer is HTTPS. I'll try fixing that and see what happens.

Nope, no luck. I moved the script onto a new consumer with https:// but doesn't seem to have helped.

Jarry1250 renamed this task from svgtranslate tool-Not Working to SvgTranslate tool fails during OAuth callback.Dec 19 2018, 2:40 PM
Jarry1250 updated the task description. (Show Details)
Samwilson edited projects, added SVG Translate Tool; removed Tools.
Samwilson added a subscriber: Samwilson.

This error was occurring with the old SVG Translate tool, and I'm not able to replicate it with the new version. Please reopen if it's still happening.