firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.23k stars 565 forks source link

Unable to connect to the server. Check your connection and try again. #5625

Open johnjeremih opened 6 months ago

johnjeremih commented 6 months ago

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

I'm using real-time remote config and I'm getting these errors

image

What happened? How can we make the problem occur? This could be a description, log/console output, etc.

Relevant Code:

image image

google-oss-bot commented 6 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

argzdev commented 5 months ago

Hey @johnjeremih, thanks for reaching out. Looking through your code snippet, at first glance there doesn't appear to be any obvious reason why this issue is happening. Are you constantly able to reproduce this behavior? Or is there a certain condition to encounter this behavior?

johnjeremih commented 5 months ago

@argzdev these are the errors I'm getting on Firebase image

lehcar09 commented 5 months ago

Hi @johnjeremih, thank you for those details. I was able to encounter the issue once in the BOM version 32.2.0, however, I wasn’t able to reproduce the issue.

It seems to me that the behavior you’re experiencing is similar to this report (#5159). Based on this comment, according to the investigation of our engineers, the behavior is intended.

“The reason why Crashlytics says it in the background for these exceptions could be due to a race condition between when our SDK thinks it's in the background compared to when Crashlytics is in the background. In the stack trace, there is a reference to a method called notifyRCInstances. This method is only called when the app switches from background to foreground or vice versa. And in the case of background to foreground we retry the connection automatically which is what it looks like is happening. So in conclusion I think connections aren't being made in the background, it just looks that way due to a race condition between real-time and crashlytics logging.”

As mentioned in case, It should be safe to ignore.

With that, I'll close this ticket now. Feel free to let me know if you think this is a mistake. If so, please provide with us a minimal reproducible example or steps to reproduce this behavior showing repeated calling of the exception.

johnjeremih commented 5 months ago

image

I just got this error "Config update error with code: CONFIG_UPDATE_STREAM_ERROR"

cotchoninha commented 3 months ago

I'm having the same problem, but on my iOS application. The config listener used to work in the past and now I keep getting Optional(Error Domain=com.google.remoteconfig.update.ErrorDomain Code=8001 "Unable to connect to the server. Check your connection and try again." UserInfo={NSLocalizedDescription=Unable to connect to the server. Check your connection and try again.})

asetiyadi-MLB commented 1 week ago

I have similar error in iOS and it is happening whenever the app is brought into the foreground from background mode. iOS Firebase SDK 10.22.1

Error Domain=com.google.remoteconfig.update.ErrorDomain Code=8001 "Unable to connect to the server. Check your connection and try again." UserInfo={NSLocalizedDescription=Unable to connect to the server. Check your connection and try again.}