-
Notifications
You must be signed in to change notification settings - Fork 4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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] Could not reach Cloud Firestore backend over Wifi on physical device. #2753
Comments
Here is the debug console output: Over Wifi - When the error happens
Over LTE - When things work fine
|
I highly doubt this is an issue with FlutterFire, since it has no impact on how the native SDKs handle online/offline state. |
Hi @mlemos flutter doctor -v
Thank you |
I am also facing the similar issue, in my case, it reaches to the cloud_firestore but returns null in _data with real iOS device when connected to WiFi. |
HI @TahaTesser , I just performed a "reset to factory defaults" on my Pixel 3XL and the problem persisted. It happens on both my Pixel 4XL and Pixel 3XL. I'll grab another device today and perform more testing. What is interesting is that both Firestore and Crashlytics provide error messages while running over wifi. It seems that the firebase plugin is not correctly identifying the connectivity status and is assuming that it is not connected over wifi in those circumstances. Probably a shared code between Crashlytics and Firestore causing the error on both packages. Crashlytics error:
Firestore Error:
|
Hi @TahaTesser, I finally put my hands in another device and the results were the same. I have also updated my Flutter environment and all libraries. The key error messages are:
Flutter Doctor -v is:
|
Strangely, now the tests are like this:
All of them using the same Wifi and same 3G network. |
@mlemos Are you able to access the firestore hostname from a browser on the devices that are not working? |
For me I have 1 Mi-A2(Android Phone) and 1 iPhoneXR here are the test results.
So I have a bit different configuration of WiFi. Wifi 1 = Main Wifi given by the service provider (with DHCP enable) So when I connect my iPhoneXR on Wifi 2 it start throwing the exception mentioned. But I connect to Wifi 1 it works perfectly. If I disable the DHCP of wifi 2 and use it as a switch and keep the DHCP enable of Wifi 1 then also it works perfectly. So I think there is some issue with dynamic IP and network connection and that's why it is causing the exception(Thinking loud) I hope this will help to resolve this issue. |
I am facing a similar issue. any solution so far I got a new broadband connection yesterday and saw a few firebase package update in the package.json. Could these be related? |
hi, I am also facing the same issue, for me it doesn't work on Airtel 4G network but it works on Idea 4G network, though both are good network providers, also I tested on WIFI, it works fine, I get same results across the devices. Please help |
I have the same issue, doesn't work my device Redmi Note 8 Pro - on Airtel 4G but works on Airtel 2G and also on Wifi (Airtel Broadband). |
FlutterFire just sends some data from Dart, which hits the native Firebase SDKs, and sends the data back once they return some data. There isn't anything to debug on our end since it's a Firebase/SDK/location problem. Have you raised a ticket directly with Firebase? |
Hi All, after trying many different approaches to this error I was not able to systematically reproduce it. The networks are very very similar, same ISP, same configurations, same hardware, and I was not able to identify any differences between them that could be linked to the error. On my side, I quit trying to solve the issue. However, there is definitely something here... and we need a better way to understand such basic and critical issues like network issues with Flutter and Firebase as those are key for reliability in the apps being developed. |
Hello! I am also facing the same issue here with Crashlytics. Using a physical tablet (ProDVX 22") Crashlytics does not initialise correctly with the error:
But with the emulator it works fine:
Both are on the same Wifi network. Running the exact same app. Going to the settings URL displayed in the log is working fine on the tablet with Chrome and also on my laptop. And the result is displayed in less than 1 second. Official Google/Firebase support ask me to fill the issue here, since they don't address Firebase/Flutter related API. |
Hello. I have the same issue, but for Samsung J6 and J4. I have some Flutter applications, everything works fine in every device, but Samsung. I bought a Samsung J6, just for testing, and I installed one of my apps from the play Store and it was completely blank. After 3 minutes, just staring the screen, the data showed. Detail: I have other app pubished but with SQL database. This one worked well. So I think it is something related to Firebase. Antoher detail: the same code from Web works. I think the problem is it takes a long time to get wi-fi connection from Samsung. One detail: this device only connects in wi-fi 2.4ghz With the debub app and completely connected in wi-fi, we get this: W/Firestore(32621): (21.3.0) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds After 3 minutes, it finally shows data. I put the installed apk from Play Store for debugger and I think this verbose may be important: 2020-11-13 13:59:38.721 28883-25297/? W/NetworkScheduler: Error inserting flex_time=3534000 job_id=-1 period=7069000 source=16 requires_charging=0 preferred_network_type=1 target_class=com.google.android.gms.measurement.PackageMeasurementTaskService user_id=0 target_package=com.google.android.gms tag=Measurement.PackageMeasurementTaskService.UPLOAD_TASK_TAG task_type=0 required_idleness_state=0 service_kind=0 source_version=203915000 persistence_level=1 preferred_charging_state=1 required_network_type=0 runtime=1605286778713 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0, error message: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE[2067]) [CONTEXT service_id=218 ] I get the following erros from the published app: 2020-11-13 13:54:09.753 3300-3534/? E/NetdEventListenerService: handleMessage: { when=0 what=10001 obj=com.android.server.connectivity.NetdEventListenerService$DnsResultParams@c36a3bb target=com.android.server.connectivity.NetdEventListenerService$DnsEventHandler } There is this error too: There is this error: 2020-11-13 14:57:22.263 14098-14115/com.oneplanet.historiasparadormir E/MediaHTTPConnection: java.lang.NullPointerException: Attempt to invoke virtual method 'java.net.URLConnection java.net.URL.openConnection()' on a null object reference |
This is really urgent! The apps are blank in some devices!! |
I also reproduced this issue on another out of the box tablet through a working wifi connection:
Maybe there is something obvious to solve this issue, but in the meantime our app can't send analytics or crash report... |
It is not possible to use Firebase due to this error. |
Another log: E/flutter (25716): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: [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. |
Has anyone found a workaround for this issue? |
Nope... It doesn't work on some device model, sadly this is the model which should go to production, we will not be able to monitor crash and analytics for this application... |
@jdimond Do you think you could help us here? The message comes from onlinestatetracker. If you check in the code there is a comment: The weird part is that onlinestatetracker is in ios/Pods? but the message occurs when we use Android. Or am I wrong? // To deal with transient failures, we allow multiple stream attempts before |
I also encountered this problem, but the issue has been resolved a few days back on one of my devices. |
Here, it happens all the time in some devices in wi-fi. The same app is working fine in one device, and it doesn't work in other. |
@ElaineSchwner What I found after hours of testing that the problem isn't with the device, but the network. On the devices in which the app isn't working, try using a network different than you are using on that device. |
Yes, it doesn't work if the network is connecting in wi-fi through a 2.4 Mhz router. But some devices, like Samsung J6, only connect in 2.4Mhz, it doesn't connect in a 5.0 Mhz. But how can we tell the users that our app doesn't work on wi-fi? It is an issue that needs to be corrected. |
Yes, absolutely there is no way to tell the users that our app doesn't work on wi-fi. |
i have a case where im testing on a simulator ( iphone ) and the app works on a version of the device but not in another. Connected to the same network ( wifi ) but different results. |
Same here, on the same network it works on the simulator but not on two devices, all of them can connect to the Internet. Firebase support did not want to address the issue, since FlutterFire is not supported. |
I just created a native app (kotlin) and made a simple list connecting with Firebase for testing purpose. It worked fine, on the same device that doesn't work with FlutterFire. So I think it is problem with this package not with Firebase. |
I downgraded to cloud_firestore: 0.13.6 And it started working. |
I have the same problem on emulator. It worked fine when I was connected to a VPN in Switzerland. Once I turned off the VPN (I'm in Lithuania) and it started failing to get the data from firestore. Haven't tested on physical device yet. cloud_firestore: 0.14.3+1 |
I have the same issue 😭 |
I am seeing this issue in production, this is a very critical issue, users can't access their data. |
I do not understand why this bug is not tagged with impact:critical. It is a show stopper for 100% of the apps wanting to integrate Flutterfire. |
We have a similar issue in our app and we're receiving many reports from users that data sometimes stops syncing. One of the users reported that the issue occurs only when he is connected via WiFi, but works correctly via mobile data.
We were finally able to reproduce it on Android physical device. Steps to reproduceSteps to reproduce the behavior:
_onLike method was modified to include timeout
For some reason, sort actions which fetch data from Firestore still work. To make everything work again just turn the internet connection off/on. Expected behaviorFirestore connection status should update according to the internet connection status. Additional contextWe managed to reproduce this issue on Samsung Galaxy S10e device with Android 11. Flutter doctorRun Click To Expand
Flutter dependenciesRun Click To Expand
|
This will need to reporting to Firebase support directly, there is not much FlutterFire can do here, we're just a wrapper to the underlying native SDKs - so if you haven't already then please raise a support ticket with Firebase support, or directly on the Firebase Android SDK repositories. I'm going to move this to a discussion as it's not something we can 'resolve' as I mentioned. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Describe the bug
When trying to get a document from Firestore, if the device is connected through Wifi the connection fails with the following error message:
To Reproduce
Usually, the error happens when running in a Physical device.
I created a small app to be able to reproduce the errors with minimal interference from the rest my code. See the code below.
When you hit run on the debugger (I'm using VSCode) and then I click on the (+) button to make the request to Firestore, it stays trying for a few seconds (you'll see the progress indicator no the test app) and then the call
snapshot = await docRef.get()
fails with the following error message:Then, if you turn the wifi off, the request works perfectly. And the content of the document retrieved from Firestore is present in the screen:
Now if you turn the wifi again, the request works. Sometimes the data is retrieved from the server and other from the cache.
Expected behavior
Since the device has perfect connectivity over wifi, it was excepted that the request worked fine and the document was retrieved from the server.
Additional context
On the emulator, everything works perfectly.
I tested in the following emulator configurations: Pixel 4 API 29, Pixel 5 API 25, Pixel 3 API 29.
The physical devices I used to test (both failed identically) where: Pixel 4XL (Android 10 QQ3Q.200605.001) and Pixel 3XL (Android 10 QQ2A.200305.002).
Flutter doctor
pubspec.yaml
/build.gradle
/app/build.gradle
The text was updated successfully, but these errors were encountered: