1. lohre
  2. gae_channel
  3. Issues
Issue #1 new

401 Unauthorized

Anonymous created an issue

I get an 401 Unauthorized Exception, even when I try the demo. I can't find anything wrong with my code or app config, so I'll post it as an issue...

Here's the stack trace:

Your channel name is: lGDLXZMXco
now run in an other terminal:
python sender.py lGDLXZMXco
I'm now listening for messages, dont close this terminal...
Fetching sid
Traceback (most recent call last):
  File "receiver.py", line 36, in <module>
    main()
  File "receiver.py", line 16, in main
    listen(token)
  File "receiver.py", line 31, in listen
    for msg in chan.messages():
  File "../gae_channel/__init__.py", line 135, in messages
    self._fetch_sid()
  File "../gae_channel/__init__.py", line 264, in _fetch_sid
    conn = urllib2.urlopen(url, data=urllib.urlencode(post_data))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 401: Unauthorized

Comments (12)

  1. lohre repo owner

    Hm perhaps. Personally I don't use gae_channel anymore, so I probably wont fix this anytime soon. But feel free to send a pull request ;)

  2. Jacek Nowak

    I'm trying to use the channel API in my kivy mobile app and get the same unauthorized error. Can you share how you solved the issue? I looked into the source code and found "hangoverapi.appspot.com" url inside, so I changed it to my own GAE app name, but it did not help - still the same error in the _fetch_sid method.

  3. shikha_kejariwal

    Hello Jacek Nowak , in the method "def messages(self):" which is in file init.py, if you add "self.initialize()" before self._fetch_sid()..then it will solve the unauthorized issue. Let me know if you have any other questions..

  4. Jacek Nowak

    Thanks, now I'm in the same spot you are - I get the HTTP 400 Unknown SID error practically immediately after trying to listen to channel messages. I saw your Stack Overflow comment, but I don't think that this is the same issue. The original issue is from May 2012 and is about connection break after a few minutes. I have errors after seconds (or even less). Must be something else IMO.

  5. Jacek Nowak

    I still cannot get the channel API to work. Most of the time I get HTTP 400: Unknown SID from GAE (although I check the logs and the SID should be fine). Is the API working for you currently? Can you share your version of the gae_channel library if it does? My addres is jaacek.noowak(at)gmail.com.

  6. Log in to comment