michaelhelmick / python-tumblpy

A Python Library to interface with Tumblr v2 REST API & OAuth
BSD 2-Clause "Simplified" License
122 stars 36 forks source link

oauth issue #26

Closed srinivasuk closed 9 years ago

srinivasuk commented 10 years ago

tried to use your python package but got below error...how can i fix this issue?

Traceback (most recent call last): File "test.py", line 4, in auth_props = t.get_authentication_tokens(callback_url='http://www.xyz.com/somecallbackurl/index.php') File "/opt/.softroot/python-tumblpy/tumblpy/api.py", line 61, in get_authentication_tokens raise TumblpyAuthError('Seems something couldn\'t be verified with your OAuth junk. Error: %s, Message: %s' % (response.status_code, response.content)) tumblpy.exceptions.TumblpyAuthError: Seems something couldn't be verified with your OAuth junk. Error: 401, Message: oauth_timestamp is too far away; we believe it is now 1390665118, you sent 1390643508, 21610 seconds away

michaelhelmick commented 10 years ago

Try running ntpd -q in terminal. That will reset your system clock. That is a possible solution that has worked for many.

srinivasuk commented 10 years ago

i just did that..it gives same error....trying to find solution for last 2 days...tried another python package for github still it is the same..

i am running this in amazon AWS EC2 instance...

date Sat Jan 25 10:04:53 UTC 2014

this date is not off by much...

raise TumblpyAuthError('Seems something couldn\'t be verified with your OAuth junk. Error: %s, Message: %s' % (response.status_code, response.content)) tumblpy.exceptions.TumblpyAuthError: Seems something couldn't be verified with your OAuth junk. Error: 401, Message: oauth_timestamp is too far away; we believe it is now 1390665810, you sent 1390644199, 21611 seconds away

michaelhelmick commented 10 years ago

Maybe make sure nptd is running? This may help: http://serverfault.com/questions/100978/do-i-need-to-run-ntpd-in-my-ec2-instance

--  Mike Helmick Software Engineer P: (330) 507-9098 T: @mikehelmick W: https://github.com/michaelhelmick

On January 25, 2014 at 11:05:52 AM, Srinivasu Kota (notifications@github.com) wrote:

i just did that..it gives same error....trying to find solution for last 2 days...tried another python package for github still it is the same..

i am running this in amazon AWS EC2 instance...

date Sat Jan 25 10:04:53 UTC 2014

this date is not off by much...

raise TumblpyAuthError('Seems something couldn\'t be verified with your OAuth junk. Error: %s, Message: %s' % (response.status_code, response.content)) tumblpy.exceptions.TumblpyAuthError: Seems something couldn't be verified with your OAuth junk. Error: 401, Message: oauth_timestamp is too far away; we believe it is now 1390665810, you sent 1390644199, 21611 seconds away

— Reply to this email directly or view it on GitHub.

srinivasuk commented 10 years ago

ntpd -q ran once and had quit

i ran it now with out args and it is running now...

but the error is still the same...below is the code i am using...

below is my pip list

pip list

distribute (0.6.49) httplib2 (0.8) httpretty (0.7.1) mock (1.0.1) nose (1.3.0) oauth (1.0.1) oauth2 (1.5.211) oauthlib (0.6.1) pip (1.5.1) python-oauth2 (0.5.0) python-tumblpy (1.0.2) PyTumblr (0.0.5) PyYAML (3.10) rauth (0.6.2) requests (1.2.2) requests-oauthlib (0.3.2) setuptools (0.6c11) urllib3 (1.7.1) wsgiref (0.1.2)

from tumblpy import Tumblpy

t = Tumblpy('somebig key', 'some big value') auth_props = t.get_authentication_tokens(callback_url='http://www.test.com/url/index.php') auth_url = auth_props['auth_url']

OAUTH_TOKEN_SECRET = auth_props['oauth_token_secret']

print 'Connect with Tumblr via: %s' % auth_url

michaelhelmick commented 10 years ago

Hrm, it's really hard to debug without actually being in the system. Maybe google: ec2 oauth timestamp wrong

or something of the sort? Sorry I can't be of more help :(

srinivasuk commented 10 years ago

ntpd is getting removed after few minutes...one thing i noticed is before running and after running the script throws same error but with only 1 second difference...

total time difference is 6 hours which is 21610 seconds

srinivasuk commented 10 years ago

thanks for your insights...infact your program showed what could be wrong...

even though the date command give exact time or close to my system desktop clock...

Sat Jan 25 10:33:34 UTC 2014

but the program says 6 hours apart..

michaelhelmick commented 10 years ago

You're welcome! Hope you eventually figure it out with some research!