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

'twdige setup' fails #15

Open
ndndn opened this issue Aug 13, 2010 · 29 comments
Open

'twdige setup' fails #15

ndndn opened this issue Aug 13, 2010 · 29 comments

Comments

@ndndn
Copy link

ndndn commented Aug 13, 2010

hi,

apologies for no patch, I'm too new to haskell!

This is with Twidge, version 1.0.4.

running 'twidge setup' and following the instructions always ends with:

twidge: user error (HTTP/1.1 401 Unauthorized)

@jgoerzen
Copy link
Owner

Please run with -d and see what sort of details you can get about it.

@ndndn
Copy link
Author

ndndn commented Aug 13, 2010

running with -d added no extra info that I could see:

twidge -d setup
CP /home/me/.twidgerc exists? False

Welcome to twidge. We will now configure twidge for your
use with Twitter (or a similar service). This will be quick and easy!

Please wait a moment while I query the server...

ignite done. trying request 1.
reqres params: oauth_token=croLwShbMcvRZvAhFcqnhc9C6yvLgLp8Ophv9390tA&oauth_token_secret=eSr9Y4PNzbQLNP7b8O68JXdKRnqCOe9ymzdlOq3v6o&oauth_callback_confirmed=true

request 1 failed. attempting workaround.
reqres params: oauth_token=F7YqOPf6gWc0P3GA3QmcLHFcImdZBZbdgViciEWONCc&oauth_token_secret=v7oJI96KdHlHpc0cqNqoIcXDHnekrFFgMDc83AIiGk&oauth_callback_confirmed=true
OK, next I need you to authorize Twidge to access your account.
Please cut and paste this URL and open it in a web browser:

https://twitter.com/oauth/authorize?oauth_token=F7YqOPfg6Wc0P3AG3QmcHLFIcmdZBbdZgViciEWONCc

Click Allow when prompted. You will be given a numeric key in your browser window. Copy and paste it here.
(NOTE: some non-Twitter services supply no key; just leave this blank if you don't get one.)

Authorization key: 1145943
twidge: user error (HTTP/1.1 401 Unauthorized)

@jgoerzen
Copy link
Owner

I was really hoping there'd be some output right around the 401 error. It's odd that there isn't. The other thing you could try is to remove the https (just use http) and throw a tcpdump across the network so we can see the HTTP headers.

@ndndn
Copy link
Author

ndndn commented Aug 13, 2010

ok, have done, what should I be looking for? i see very little between 'successfully granted access to twidge!" and the 401, only the GET to GET /statuses/friends_timeline.xml?count=1 HTTP/1.1\r\n - which results in the 401 response...

@williamsonday
Copy link

Hi, just wanted to let you know that I am having the same difficulty. I am not sure exactly how to do the tcpdump you are asking for, but I would be willing to try if you point me in the direction of some reasonable instructions.

@jgoerzen
Copy link
Owner

What version of hoauth do you have installed? If not 0.2.3, can you try it again with that one?

@ndndn
Copy link
Author

ndndn commented Aug 24, 2010

just tried again after downgrading to hoauth-0.2.3 - same results as with 0.2.5

@jgoerzen
Copy link
Owner

Drat. Well I will do some more testing tomorrow and try to duplicate it.

@jgoerzen
Copy link
Owner

Guys, I just can't duplicate this. I'm baffled by what you're seeing. Can you:

  • Reproduce it 100% of the time, over a period of days? (Twitter is infamous for mysterious failures)
  • Reproduce it with 1.3.5 version of the Haskell curl library
  • Let me know the exact versions of all deps you're using
  • use the non-SSL twitter URL
  • With the non-SSL twitter URL, grab a tcpdump or similar network trace so I can see exactly what is being sent and received
  • Run with -d

@ndndn
Copy link
Author

ndndn commented Aug 25, 2010

hi,

  1. yes, every time, over many days
  2. yes, with curl-1.3.5
  3. ghc-pkg list output: http://dpaste.com/233937/
  4. have done
  5. also have done, in above comment
  6. also have done, in above comment

with regard to 5) I just dumped the headers, maybe this was wrong, exactly what tcpdump output will help?

cheers everso.

@jgoerzen
Copy link
Owner

I don't see any headers or anything else after you pasted your key, which are the bits that are relevant. Headers and body both matter. Actually you haven't posted headers either. I'm lloking for every byte sent to or from the twitter servers.

@jgoerzen
Copy link
Owner

Also I notice you are on GHC 6.10. Most of the stack used by twidge is currently really only deployed on GHC 6.12. You might also try that version of GHC and look for a change.

@ndndn
Copy link
Author

ndndn commented Aug 25, 2010

no, I did not post the ouput of tcpdump, i looked through it, and commented above. I did not want to paste a massive cap file. I will try upgrading to ghc 6.12 before tcpdumping again.

I was finding it awkward to narrow the twitter hosts down, to try and limit the cap file to only relavent stuff, I'll try again after a ghc upgrade.

@ndndn
Copy link
Author

ndndn commented Aug 25, 2010

ghc 6.12 is still compiling - but for what it is worth, should I send you a cap file?

@jgoerzen
Copy link
Owner

Yes, that would be helpful.

@ndndn
Copy link
Author

ndndn commented Aug 25, 2010

sent to your email address (i hope)

@jgoerzen
Copy link
Owner

jgoerzen commented Sep 1, 2010

I am not certain, but there is a chance that twidge 1.0.5 and the tips here http://wiki.github.com/jgoerzen/twidge/frequentlyaskedquestions will fix the issue for you. Can you try?

@jgoerzen
Copy link
Owner

jgoerzen commented Sep 1, 2010

For the record -- ndndn and I looked at his dumps and eventually discovered that the binary I have posted here worked fine for him while the one he compiled didn't. We haven't isolated the difference yet.

@ndndn
Copy link
Author

ndndn commented Sep 1, 2010

hi, I've installed twidge 1.0.5, gone through that URL, and unfortunately I get the same 401 error attempting to sign up. no errors during build. I am going to try this build on other machines, given your binary worked.

@aisamu
Copy link

aisamu commented Oct 7, 2010

Hi!
Just to let you know that I have the exactly the same issue!
Running from a clean Haskell Package 2010.2, installed from cabal (twidge version 1.0.4 - had to force hoauth < 0.3).
Twitter says I successfully authorized twidge, but twidge gives me the HTTP 401.

@jgoerzen
Copy link
Owner

It is probable that you see the revoked key problem. Try 1.0.6

@RFDAJE
Copy link

RFDAJE commented Nov 20, 2010

I am still having the exact problem on twidge git lastest, opening the auth link and tried input the pin always failed.

twidge -d setup
CP /home/xxx/.twidgerc exists? False

Welcome to twidge. We will now configure twidge for your
use with Twitter (or a similar service). This will be quick and easy!

Please wait a moment while I query the server...

ignite done. trying request 1.
reqres params: oauth_token=j6T9v6Nb1DZoAJ6i5njJ7HCMiyQkUlZM7G6Ev6o&oauth_token_secret=Uk6fq45pmknbSQ89eLEhSE6E4b43IvnVrlYsbuNNKg&oauth_callback_confirmed=true
request 1 failed. attempting workaround.
reqres params: oauth_token=IdBGiIvOEUUoFteK2wwI4bvcxciPPmY7y8TH0jSVg&oauth_token_secret=Wh4S1ERHJkOABI6gugV1k7GcscXHuQepHvqzPoNjOb8&oauth_callback_confirmed=true
OK, next I need you to authorize Twidge to access your account.
Please cut and paste this URL and open it in a web browser:

https://api.twitter.com/oauth/authorize?oauth_token=IdBGiIvOEUUoFteK2wwI4bvcxciPPmY7y8TH0jSVg

Click Allow when prompted. You will be given a numeric
key in your browser window. Copy and paste it here.
(NOTE: some non-Twitter services supply no key; just leave this blank
if you don't get one.)

Authorization key: 7074776
twidge: user error (HTTP/1.1 401 Unauthorized)

@RFDAJE
Copy link

RFDAJE commented Nov 20, 2010

and I also tried to use my own api key in ~/.twidgerc

$ cat ~/.twidgerc

[DEFAULT]

oauthconsumerkey=xxx
oauthconsumersecret=xxx

but after input the pin, failed with 401, too.

@jgoerzen
Copy link
Owner

seenxu: what version are you using, and did you try my binaries posted here on this site?

@RFDAJE
Copy link

RFDAJE commented Nov 23, 2010

@jgoerzen I am using git latest, and twidge-1.0.6-linux-x86_64.bin works fine for me.

@jgoerzen
Copy link
Owner

OK. I am going to need someone to figure out why my builds work while yours don't. Obviously I can't reproduce the problem here...

@RFDAJE
Copy link

RFDAJE commented Nov 23, 2010

@jgoerzen I don't really know how oauth works, only guess, can it be dependency's problem, haskell-curl, haskell-sha, etc? which are caused to generate wrong auth token?

@dequegorg
Copy link

Hi there,

Same issue on setup:

CP /home/benjamin/.twidgerc exists? False

Welcome to twidge. We will now configure twidge for your
use with Twitter (or a similar service). This will be quick and easy!

Please wait a moment while I query the server...

ignite done. trying request 1.
reqres params: error HTTP/1.1 401 Unauthorized
request 1 failed. attempting workaround.
reqres params: error HTTP/1.1 401 Unauthorized
twidge: user error (Error from oauthRequest: "HTTP/1.1 401 Unauthorized")

@jean
Copy link

jean commented May 7, 2011

Hehe, this was my first stop after installing twidge (Ubuntu 10.10, twidge 1.0.2). Anyone after me, https://github.com/jgoerzen/twidge/wiki/frequentlyaskedquestions and http://blog.nelhage.com/2010/09/dear-twitter/ pertains.

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

7 participants