Something ain't thread safe: OAuthError: No access to private resources at "api.twitter.com". #85

Closed
jpic opened this Issue May 26, 2011 · 0 comments

Comments

Projects
None yet
1 participant

jpic commented May 26, 2011

Hi all,

After some time, i receive the following trackback. I can't use twitter login anymore then. I restart the server and everything works again.

In my case I "think" I "fixed" it by reducing the threads max-requests from 5000 to 35 in uWSGI. But there is definitively more to dig.

For starters: anyone else experiences this issue ? It looks like an error from my code, which hasn't anything appearing non-thread safe... so I'm stuck on that.

Traceback (most recent call last):

 File "/srv/playlistnow.fm/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 100, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/srv/playlistnow.fm/prod_env/src/socialregistration/socialregistration/views.py", line 176, in twitter
   user_info = client.get_user_info()

 File "/srv/playlistnow.fm/prod_env/src/socialregistration/socialregistration/utils.py", line 330, in get_user_info
   user = simplejson.loads(self.query(self.url))

 File "/srv/playlistnow.fm/prod_env/src/socialregistration/socialregistration/utils.py", line 319, in query
   _('No access to private resources at "%s".') % get_token_prefix(self.request_token_url))

OAuthError: No access to private resources at "api.twitter.com".


<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'__utma': '178145764[snip]1.40',
 '__utmb': '17[snip]1',
 '__utmc': '178145764',
 '__utmz': '17814576[snip].utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=playlist.fm',
 'csrftoken': '[snip]',
 'sessionid': '[snip]'},
META:{'CONTENT_LENGTH': '',
 'CONTENT_TYPE': '',
 'CSRF_COOKIE': '[snip]',
 'DOCUMENT_ROOT': '/usr/local/nginx/html',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE:'[snip]',
 'HTTP_HOST': 'playlistnow.fm',
 'HTTP_KEEP_ALIVE': '115',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1',
 'PATH_INFO': u'/socialregistration/twitter/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '24.30.30.99',
 'REMOTE_PORT': '38682',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/socialregistration/twitter/',
 'SCRIPT_NAME': u'',
 'SERVER_NAME': 'playlistnow.fm',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'uwsgi.version': '0.9.7.2',
 'wsgi.errors': <open file 'wsgi_input', mode 'w' at 0x23650c0>,
 'wsgi.file_wrapper': <built-in function uwsgi_sendfile>,
 'wsgi.input': <open file 'wsgi_input', mode 'r' at 0x2365f60>,
 'wsgi.multiprocess': True,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>

@jpic jpic closed this Feb 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment