{"action":"created","issue":{"url":"https://api.github.com/repos/sixohsix/twitter/issues/294","labels_url":"https://api.github.com/repos/sixohsix/twitter/issues/294/labels{/name}","comments_url":"https://api.github.com/repos/sixohsix/twitter/issues/294/comments","events_url":"https://api.github.com/repos/sixohsix/twitter/issues/294/events","html_url":"https://github.com/sixohsix/twitter/issues/294","id":89603379,"number":294,"title":"TwitterStream.user() fails on production server, works in local development environment","user":{"login":"lmaloney","id":843220,"avatar_url":"https://avatars.githubusercontent.com/u/843220?v=3","gravatar_id":"","url":"https://api.github.com/users/lmaloney","html_url":"https://github.com/lmaloney","followers_url":"https://api.github.com/users/lmaloney/followers","following_url":"https://api.github.com/users/lmaloney/following{/other_user}","gists_url":"https://api.github.com/users/lmaloney/gists{/gist_id}","starred_url":"https://api.github.com/users/lmaloney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmaloney/subscriptions","organizations_url":"https://api.github.com/users/lmaloney/orgs","repos_url":"https://api.github.com/users/lmaloney/repos","events_url":"https://api.github.com/users/lmaloney/events{/privacy}","received_events_url":"https://api.github.com/users/lmaloney/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-06-19T16:19:50Z","updated_at":"2015-06-19T17:28:32Z","closed_at":null,"body":"OK, this is a hard one.... when I've gotten this error before, it typically meant I lost the connection to twitter, and a quick restart fixes everything, but not anymore...\r\n\r\nHere is the stack trace:\r\n\r\nauth = twitter.Oauth( ... keys )\r\n\r\n# Code:\r\nfrom twitter import *\r\nstream = twitter.stream.TwitterStream(auth=auth, domain='userstream.twitter.com')\r\nstream.user()\r\n\r\n#Trace:\r\nTraceback (most recent call last):\r\n  File \"<console>\", line 1, in <module>\r\n  File \"/usr/local/lib/python2.7/dist-packages/twitter/api.py\", line 308, in __call__\r\n    return self._handle_response(req, uri, arg_data, _timeout)\r\n  File \"/usr/local/lib/python2.7/dist-packages/twitter/stream.py\", line 284, in _handle_response\r\n    _timeout or timeout, heartbeat_timeout)\r\n  File \"/usr/local/lib/python2.7/dist-packages/twitter/stream.py\", line 209, in handle_stream_response\r\n    raise TwitterHTTPError(e, uri, 'json', arg_data)\r\n  File \"/usr/local/lib/python2.7/dist-packages/twitter/api.py\", line 72, in __init__\r\n    data = json.loads(data.decode('utf8'))\r\n  File \"/usr/lib/python2.7/json/__init__.py\", line 338, in loads\r\n    return _default_decoder.decode(s)\r\n  File \"/usr/lib/python2.7/json/decoder.py\", line 366, in decode\r\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\r\n  File \"/usr/lib/python2.7/json/decoder.py\", line 384, in raw_decode\r\n    raise ValueError(\"No JSON object could be decoded\")\r\nValueError: No JSON object could be decoded\r\n\r\n# =========\r\n\r\nThis code is from my program, which works just FINE in my local development environment.\r\n\r\nLocal Dev =\r\n\r\nUbuntu 14\r\nPython 2.7\r\nWingIDE\r\nVirtualEnvirnment with depenedencies installed.\r\n\r\n\r\nHowever, on my server, hosted on EC2 it fails:\r\n\r\nUbuntu 14\r\nPython 2.7\r\nVirtual Environment\r\nRun from command line with python manage.py shell , then load program with execfile('mybot.py')\r\n\r\nThe same code has been working, but stopped suddenly with the above JSON error.\r\n\r\nIf I run the same code in DEV on my local system, it works, however running on production server, it fails.\r\n\r\nIf compared the environments between both systems, and they SEEM to be the same...\r\n\r\nOn the production server I CAN do OTHER streaming functionality like SENDING DM's to my twitter account....  So SENDING works, but listening with stream.user() FAILS with this JSON error.\r\n\r\nI would appreciate ANY suggestions. :)\r\n\r\nThank you,\r\n\r\nPS: Love this tool, I think it's better than the other Python Twitter options out there."},"comment":{"url":"https://api.github.com/repos/sixohsix/twitter/issues/comments/113581990","html_url":"https://github.com/sixohsix/twitter/issues/294#issuecomment-113581990","issue_url":"https://api.github.com/repos/sixohsix/twitter/issues/294","id":113581990,"user":{"login":"RouxRC","id":1153255,"avatar_url":"https://avatars.githubusercontent.com/u/1153255?v=3","gravatar_id":"","url":"https://api.github.com/users/RouxRC","html_url":"https://github.com/RouxRC","followers_url":"https://api.github.com/users/RouxRC/followers","following_url":"https://api.github.com/users/RouxRC/following{/other_user}","gists_url":"https://api.github.com/users/RouxRC/gists{/gist_id}","starred_url":"https://api.github.com/users/RouxRC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RouxRC/subscriptions","organizations_url":"https://api.github.com/users/RouxRC/orgs","repos_url":"https://api.github.com/users/RouxRC/repos","events_url":"https://api.github.com/users/RouxRC/events{/privacy}","received_events_url":"https://api.github.com/users/RouxRC/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T17:28:32Z","updated_at":"2015-06-19T17:28:32Z","body":"this is quite weird, not sure what to do here... @sixohsix an idea?"}}