-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[firestore/unavailable] The service is currently unavailable #6474
Comments
In my experience, usually Google Compute Platform does not like the client's network endpoint (blocklisted VPN IP address or similar) or the network is down, or API keys are restricted or similar. Impossible to say without being able to definitely reproduce it with knowledge of the client's network environment, and knowledge of the google computer platform / firebase project / API key configuration |
I've tested on the same network both iOS and Android, iOS works fine, on Android sometimes I see this error, and whenever this happens right after it when I try another request (like |
That's odd - I wonder if the android device is somehow putting the network to sleep aggressively, for instance for power-saving. It appears to be this case from the error message:
|
that's possible I guess, the solution can be to catch this error and retying to do the same call again. |
I am getting the same issue |
@AdnanIqbalKhan you assert
...but providing no evidence to back up the assertion Troubleshooting requires precision, accuracy, and details. In the future please do not "metoo" post on other people's details unless you are certain based on concrete evidence you have the same issue. The original poster has provided some logging indicating it may be that the app is having a transient network connectivity issue. No one has reported followup information where details about the network environment at the time of the error are provided, so we just have a hypothesis right now and are waiting for details |
@mikehardy I don't know what causes the issue |
The problem is with Android Emulator v 31.3.10 Turning off wifi in the emulator and turning on its data connection works for me. Check these for further details. |
I've had the same problem for years with react-native-firebase. What happens (I think) is that OS battery saver/optimisation settings kill the firestore connection while the app is backgrounded for some time (a few minutes). After opening the app again, firestore takes quite a long time to reconnect - around 30 seconds up to 1 minute. Get queries return the [firestore/unavailable] error, but subscriptions just silently wait until firestore is reconnected. It's been a really annoying issue to deal with and I haven't seen any proper solutions for that yet. As a workaround I'm currently using firestore REST API to fetch data in addition to subscriptions in the more critical places in the app. From crashlytics logs it seems to be happening slightly more on iOS, but I've found it to be easier to reproduce on Android. Specifically Androids 10 to 12. To reproduce this issue:
|
Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
Thank you for your contributions. |
In my case , the problem was that i was trying to use offline persistence without caching the data first . So , make sure you have fetched first before trying to make use of offline-persistence . |
1 similar comment
In my case , the problem was that i was trying to use offline persistence without caching the data first . So , make sure you have fetched first before trying to make use of offline-persistence . |
This is still happening with the latest version "20.30.0" with iPhone SE (3rd generation) simulator and using Firebase emulators with auth and firestore. Do you have an official guide or solution for this? |
still happening |
For me the error was taking place due to some WiFi issues. When I switched to another network it disappeared. |
has anyone fixed this issue, it happened to me too, and I couldn't find any fix. |
Hello, I'm experiencing the same error. Is there a way to check if the connection has been restored or not? |
perhaps https://reactnative.dev/docs/appstate#addeventlistener listen for transition to foreground, do a test get to firestore and if it is unavailble try a pair of calls to toggle the network down then up https://rnfirebase.io/reference/firestore#disableNetwork / https://rnfirebase.io/reference/firestore#enableNetwork I have not tried this but something like this might work If there is no way to force the network to reinit and you must wait, then in the app could also maintain a global "firestore network is available" status flag somewhere, and in the AppState listener on transition to foreground you could try a firestore doc get and update the availability flag based on the result, testing it in a loop until it is available. Use the availability flag in other areas to do what makes sense for your app's use cases... |
For me, I had named my Firestore database to something other than (default). Deleting the database, and creating a new one named (default) fixed the error. |
At first I thought it was a joke, but apparently it's a solution... |
[firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff, this error appears, although there is a network connection, this happens a lot on Android devices, and a few times on iOS.
Does anyone know what can be the problem?
I've found similar reports in issues section, but they don't seem to have any solution.
I'm using "@react-native-firebase/firestore": "^14.2.2"
The text was updated successfully, but these errors were encountered: