Closed halesyy closed 12 months ago
Okay - update - I've investigating this, and GPT4 gave me a few things to test. The first being to disable IPv6 on my server (after using ip a
to find that my server does have IPv6) to see if that fixes it. For some reason, after adding the following config lines to /etc/sysctl
in sudo:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
And running sudo sysctl -p
- this fixed it. I can now do requests.get
to all Google services.
I'm also going to try to setup Google DNS to hopefully resolve this in the future.
I feel as if the issue could have been with my server provider - their IPv6 infra went down or something? Or Google changed some resolver in their Australian cloud services? The most annoying errors are the ones that occur outside of the codebase..
It could have been a network configuration issue in your environment. Glad you found a resolution. I will close this issue for now.
[READ] Step 1: Are you in the right place?
firebase
tag.[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
What happened? How can we make the problem occur? This could be a description, log/console output, etc.
Relevant Code:
Hi all, really struggling with this one. I've had no issues with my Firebase for months, and even up to last night I had no issues at all - everything was working smoothly. But, all of a sudden, in the morning, one of our production servers (gunicorn + flask) stopped responding to requests, returning nothing.
I then went into debug mode, restarting nginx, etc, and putting prints all over the code. This showed me that the prints would go all the way up to the statement
decoded_token = auth.verify_id_token(id_token)
which is apart of one of my authentication modules utilizing firebase-admin. I then check this against my local machine (doing token issuing locally, then authenticating locally) and that worked fine.When I use
requests.get("https://accounts.google.com/o/oauth2/auth")
on my production server, it takes around 60 seconds to respond. Once it responds, it is a success 200 with the auth page. The same occurs withhttps://oauth2.googleapis.com/token
(longer, had to time it out when it reached 3 minutes), and I imagine all following Google APIs. If I request one of my own sites, it resolves quickly as expected. If Icurl -I https://oauth2.googleapis.com/token
, I swiftly get:In fact, I've also just tested
requests.get("https://www.google.com")
and get this hanging issue, but when doingcurl "https://www.google.com"
, I get an instant response. This does not occur for GitHub, my portfolio website, Facebook, but does occur for YouTube (a Google service), I think this is the fundamental issue. Is this a Python issue?!Further, if it was able to authenticate the token (rarely), the issue would move to the Firestore client and cause 30-60-300 second hangs and error out due to bad timeouts.
I really rarely resort to issuing bug requests and I really appreciate any help with this. I feel as if there is missing logging or some sort of issue occuring for my production server client which is not being logged, and I feel as if this hang is very odd - especially since it has not occurred for the last 3 months and started overnight. If I could get any further ideas on how to debug, that would be a great help.
Error from trying to verify the ID token
Error from trying to receive data from Firestore