-
Notifications
You must be signed in to change notification settings - Fork 190
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
Occasional 401 Unauthorized errors #498
Comments
I've started seeing this too, on several accounts as of a few days ago:
This will get thrown part way through
For a large account (in the order of thousands of conversations) I've yet to get a complete call without it falling over. |
monkey patching!...
(that should probably be rolled into a configuration option or something) |
Instead of masking the issue, you can force a retry on 401: diff --git hangups/http_utils.py hangups/http_utils.py
index dd196e8..5138071 100644
--- a/hangups/http_utils.py
+++ b/hangups/http_utils.py
@@ -68,4 +68,8 @@ class Session(object):
logger.debug('Received response %d %s:\n%r',
res.status, res.reason, body)
+ if res.status == 401:
+ logger.debug('Forcing retry on unauthorized response')
+ error_msg = 'Unauthorized'
+ continue
except asyncio.TimeoutError:
error_msg = 'Request timed out' |
If it uses up
|
There's possibly two issues at play here then -- the 401s I'm seeing are few and far between, and so far I've not seen it throw one more than once per original request. |
We've (nyc) have got a ton of convos, so this might be a numbers game. |
As of today, I'm seeing these occasional errors too. |
This commit seems to fix this issue for me: |
That's adding retries as suggested above. I doubt that workaround will function for too long. I captured the parameters from a failed hangups request and tried replying it via an external script, but I can't reproduce the error there. I did notice that intentionally breaking the authorization header generator causes the server to randomly alternate between two error messages, which suggests the problem is that Google are gradually rolling out a new version of their backend that's incompatible somehow. |
I found the problem. There is an open issue in
Using |
Google appear to be randomly routing requests to a new backend that does not support quoted cookie values. Until aiohttp gets an option to disable quoting cookie values, we need to serialize the cookie header ourselves as a workaround. Fixes #498.
Fixed in version 0.4.11. |
Hello,
I started playing around with the hangups client. After going through the
hangups --manual-login
flow, I noticed that auth would occasionally get back a 401 at various points during startup.Here is an example of a failed request (
hangups -d
):My very next
hangups -d
succeeded. I didn't change any config files or the command line. The location in the logs of the above failed rpc (getselfinfo
):It's not always
getselfinfo
that fails. Sometimes it's another RPC likesyncrecentconversations
.The text was updated successfully, but these errors were encountered: