-
Notifications
You must be signed in to change notification settings - Fork 928
Intermittent "Client is offline" rejection from Realtime Database get()
#5612
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
Comments
Hi @XuluWarrior, thanks for reaching out. I tried replicating, but I wasn't able to reproduce the error. If I can replicate the issue, I can have a better look into it. Please share a minimal, but complete sample of a project that I can run locally. |
Hi @jbalidiong I don't have consistent reproduction case as I haven't actually seen it running on my local machine. In my case I think it's related to the code being run as a lambda and hence can be frozen and restored in between calls. I can see in my logs that Firebase is often disconnecting and reconnecting but usually it successfully reconnects and there is no error. Here are the logs before and after the error this morning. Perversely the last log before the error is "Primary connection is healthy" ;) |
@IanWyszynski Can you take a look? |
I have the same issue.
You can reproduce on the dev environment of my website: dev.traveledmap.com |
I was just able to reproduce it on my local machine after waiting for a few minutes to refresh the page. However I had the error just once, and then the data successfully loaded (which was not the case on the screen I sent) |
I was able to have kind of a reproduction on a new project, but I think that it's the expected behavior:
Maybe it could be related to our issue? Kazam_screencast_00002.mp4 |
I was able to have the issue with my simple example, without breakpoints:
@jbalidiong @schmidt-sebastian can you have a look please? |
Hi @qlereboursBS, thanks for adding information regarding this issue. I just want to confirm if the repository you've provided contains any code with Firebase? Currently, I'm seeing the default files when created with Next.js. Maybe some files are not uploaded in the repository. |
I'm really sorry, I just realized that the commit and push didn't work, I just pushed it. |
Were you able to reproduce @jbalidiong ? |
@qlereboursBS, unfortunately, I wasn't able to replicate it. I also waited for a few minutes before refreshing the page and I didn't encounter the error. Let me check with other engineers and see if they can replicate it on their end. |
I think it may be related to a poor connection. I'm currently in a hotel, the connection is poor, I can access pages but it's very frequent to have this error (almost everytime). When I created the issue, I was at home with a better connection (not the best, but good enough). |
I was having a problem with similar symptoms, using firebase-admin on Windows WSL. After I enabled logging on Firebase, it turned out that the problem under the hood was that my auth token was being rejected (and fwiw, due to an issue with clock being out of sync: microsoft/WSL#4245). So I wonder a couple of things:
|
The way I have to reproduce it is to put a breakpoint and just take your time to analyze what is happening. |
I have been able to reliably recreate this issue every time using a basic Firebase Database GET with the Realtime Database.
In Chrome developer tools, throttle your connection speed to mid or low tier and it will throw "Error: Client is offline." |
I had similar issue, eventually I figured I had setup the realtime database after I had already generated the Firebase config so it was missing the Find the Firebase config again from the app it should have it in the config. Hope this helps. |
The issue is the database allows one person at a time. Hence, if a method is reading from a database, this method locks the database from another method reading from the same application |
I have the same issue, ping me if you figure out something |
Almost the same for me on v9.0.1 as mentioned by @qlereboursBS
My home wifi is currently at ~5 Mbps in download (don't know why 🤷♂️) and I get the error. If I switch to hotspot at ~40 Mbps it works. This is very annoying and unpredictable behavior. Could you please fix it? |
In the meantime, I have found a workaround by replacing get calls with this. Hope it helps.
|
We're facing the same problem in our application and it's definitely related to unstable / poor internet connection. This is a major problem for us and very unpredictable. It leads to random crashes of our application. |
Able to consistently reproduce the issue this way for our application too. We have a Firebase fetch when our webpage loads. Throttling network to slow causes the Firebase fetch to fail with error Client is offline. This also happens if multiple (20-25) tabs of our application are opened simultaneously, most likely causing the network bandwidth to be divided and resulting in a slow throttling like scenario. |
We also have this issue, when connected to rather poor networks and downloading a lot of data from the DB (around 3 MB). It is very problematic for us. |
This should be fixed in the latest version of the SDK with #6340. |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Since updating my code to use Firebase 9.x and the new modular API, I am getting intermittent "Client is offline" promise rejections when calling
get()
.There is a Firebase Google Group that has other users that have experienced the same problem but I can't find a related issue in GitHub, so I thought I would raise one.
I currently running 9.1.1 and so will try upgrading to 9.1.2. I will also enable logging.
Steps to reproduce:
Relevant Code:
Call stack:
The text was updated successfully, but these errors were encountered: