Closed quandevelopment closed 5 years ago
I encountered this error when I used a new fresh firebase project. Firestore database is also needs to be activated on the firebase console.
I encountered this error when I used a new fresh firebase project. Firestore database is also needs to be activated on the firebase console.
So I have to activate Firebase Database too? It's strange because its not reproducible when the app lost the connection. But suddenly it comes online again. In the most case after I installed the app again or restart the simulator.
Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Hi, I can't solved the issue so I changed to Parse as backend. It works like a charme. Now I just use the Push Server for my App. Maybe I will try it later again.
Best Qung
Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
If you are located in China, FireStore / Google is blocked there.
It'll error out with firestore/unavailable
Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Hum... i face the same problem even I am not located in China
Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.
@Salakar We are having this issue in our production apps. Please check this
any update for this issues
Same here , it is a problem
Someone Help this happens in some times suddenly (not every time)
I've got the same problem in two different applications in production.
One possibility is that it's an error message issue.
when I'm doing .get({source: 'cachce'})
and the firebase SDK will throw
Error Domain=FIRFirestoreErrorDomain Code=14 "Failed to get document from cache. (However, this document may exist on the server. Run again without setting source to FirestoreSourceCache to attempt to retrieve the document " UserInfo={NSLocalizedDescription=Failed to get document from cache. (However, this document may exist on the server. Run again without setting source to FirestoreSourceCache to attempt to retrieve the document }
But code 14 will be translated into FIRFirestoreErrorCodeUnavailable
with error message of
The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.
which is incorrect in this case.
Any solution here? It's really blocking production release.
Did you guys figure this one out? Please update if anyone did. Thanks!
I'm also having the same problem :/
I'm facing the same issue on my App in production now and then.
`Non-fatal Exception: UnhandledPromiseRejection [firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.
Have the same bug
[firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying wit
In my case I have array in document and there are 75 items in array. I reduced array items to 50 and error gone.
I get these errors randomly, if I restart the phone they tend to go away.
Also having this issue. Any updates?
Are there any updates on this issue?
Why would there be updates on a closed issue?
Maybe @mikehardy because it should have never been closed in the first place :)
Like @zhigang1992, I can reproduce this issue when I try to get the data from the cache. On a new device or by deactivating the persistence:
await firestore().settings({
persistence: false,
});
@RichardFevrier this issue is so old, I'd recommend opening a new issue with 100% up to date versions (that is firebase-ios-sdk 6.28.1 and firebase-android-sdk BoM 25.6.0 - it's documented on rnfirebase.io how to override) to make sure we're not chasing phantoms.
You can't imagine the number of "I have the exact same problems" we get that are actually the same problem about 1% of the time, so we work with the info we have available, doing our best, and close things when they seem like the original issue is closed. With the dates on these comments so old, definitely go for a new issue with up to date versions, necessary info provided, and a repro App.js if at all possible
I had the same problem. In my case it was the settings on google-services.json that were wrong. Maybe it will help someone.
It's. revelant with _firestore.disableNetwork()
When you disable network then enable again; it does not work. It keeps disabled. So that's why getting this error.
And also I could not find any solution.
@emreakcadag there have been several upstream issues related to this, out of our control. If you instrument the code and verify we are calling the native disable/enable network APIs then the react-native-firebase module is doing what it can. You might verify with firebase-android-sdk 25.9.0 and firebase-ios-sdk pod 6.31.0 to make sure that with up to upstream SDKs this is still happening, and check their issues lists (they are on github as well under those repo names)
I had the same issue. It was a problem because the time of the test device was 1 month ago. After correcting the time, all the problems were solved.
Interesting @melodysdreamj that info may help some people. It's important to note that if you are a parent with children, it's currently a "thing to try" for children to get around various parental restrictions by setting the time on their borrowed parent's phones back in time, so having incorrect times/dates set on devices happens more than you would think.
Still have this problem. I tried to change the timezone, signout at the beginning of App.js but no luck :( @mikehardy do you have any idea how to fix it once for good? Thanks
Hello, we have the same problem. Once the device loose it's network and then back it again the firestore keep returning old data. It'a using the cache without synchronizing it until the app is not reinstalled (the local storage is deleted). Please share some workarounds if you have some.
P.S. That's happening on iOS/Android simulator/emulator and devices as well.
The best thing to do is make sure you are using the most up to date firebase-android-sdk underling, which is I think 25.13.0 (26.0.0 won't be possible to use until #4471 lands and forward ports to the new major version of the upstream library). Information on how to override the underlying SDK version (in case you do not have the most current) is on the rnfirebase.io main page I believe
It is still happening on the latest verison.
@aliasad106 does not move the issue forward but does generate notifications for everyone. How did it go when you tried each of detailed items in the comments above?
@mikehardy I'm sorry This is my environment.
So, you have outdated versions (likely not a cause, but still, why chase issues on old versions?) and on likely unreliable networks firestore is unavailable? That seems like expected behavior? There is all sorts of information you do not address about caching, network availability network state etc above.
i got the same and here is the way i fixed it. i just run yarn add @react-native-firebase/app and yarn add @react-native-firebase/firestore I also close my simulator and wipe the data before I turn it on again and it worked for me. Hopefully it works for you guys.
This is really strange issue, yesterday everything was working just fine, now this error keeps showing
[cloud_firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.
Its really a blocker and there is not valid explanation or solution!
Why everything related to Firebase always buggy and unstable!
Everything related to Firebase is pretty stable and works great for me.
Sorry you're having this experience, I can understand if you suffer frequent problems it is frustrating.
I imagine you either are attempting to use a VPN that has been flagged for abuse by google and blocked, or you don't have your project set up correctly to generate tokens (like, the device check API is not enabled or is failing for some reason) so firestore no longer believe it has sufficient privileges to authenticate to the cloud backend and fails you
In my case I was getting the error from the android emulator running on mac. I didn't notice that the android emulator didn't have internet connexion. I fixed it by adding a DNS Server as suggested in this StackOverflow answer.
That solved the emulator-not-having-internet issue, which then solved the firestore/unavailable
issue.
I am having this issue on mac on Android Emulator only. iOS emulator is running fine and is able to read the exact same data. it's not the DNS or VPN issue, as it occurs randomly. Mostly it runs fine, but suddenly one rainy day, it gives the Error.
Having this issue on some Android devices, and it seems that this happens quite often on some of the users' phones. I believe it is related to the refresh token, but don't know how to fix it.
@haoyuant my first suspicion is always a VPN for firestore unavailable. If it's not that, then if your thunch about refresh tokens is right, check all the google cloud platform API access around auth tokens and device check APIs etc
Hi @mikehardy, I already checked the API settings, looks all good and Firebase works most of the time. All of the users reported this issue are in Australia and I believe they don't use any VPN, and their network works normally since they can use other apps without any problem. If the unavailable issue occurs, the Firebase services including Cloud Functions, Authentication(network request failed) and Firestore will fail in a row even I already implemented some sorts of retry, then the users need to restart the app to fix the problem. I don't think the app itself has some logical bugs that lead to this issue, since even the very simple Firestore query on the login page fails randomly. Only happens on Android.
This may need closer work with a friendly user, a native reproduction tester app from firebase-android-sdk and some careful testing / display of Auth token / refresh token status along with network availability testing / display that user could run / send results with. No idea how we could reproduce without being in situ on the affected network
Yea actually my client she's one of the affected user, she did run some tests for me on her phone, like I told her to switch the network and make sure the network was working well, and she tried wifi/4g/other guy's hotspot, but the same issue kept happening. According to her report, when this bug occurred, she restarted the app, but the app asked her to sign in again, so it seems that the refresh token expired somehow, which I believe is same as the issue discussed in this post https://medium.com/@chonnaronghanyawongse/coding-diary-why-my-firestore-doesnt-work-2db41fb82121
I added some code to catch the unavailable exception, and tried to get the refresh token from the cloud but in some cases (roughly 50% of the time) the request still failed 3 times in a row with roughly 3 sec retry delay for each.
Issue
Environment
Application Target Platform: Android
Development Operating System: macOs HighSierra
Build Tools:
React Native
version: 0.56.0React Native Firebase
Version: 4.3.7Firebase
Module: FirestoreAre you using
typescript
? noAfter a while a get the following error: Error: Firestore: The service is currently unavailable. (firestore/unavailable). at createErrorFromErrorData (NativeModules.js:146) at NativeModules.js:95 at MessageQueue.invokeCallback (MessageQueue.js:392) at MessageQueue.js:128 at MessageQueue.guard (MessageQueue.js:291) at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:127) at t (RNDebuggerWorker.js:1)
Then I have to deinstall and reinstall the app to get the connection again. I tried the new function
firebase.firestore().enableNetwork() but it doesn't work.
Any ideas?
Best Qung