Firestore transient condition issue - firebase

I just upgraded my Flutter project dependencies to the latest version. After upgrading to the latest version it started throwing an exception whenever I try to fetch data from Firestore. However I am able to fetch data from a real time database.
Error:
E/flutter ( 3036): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] 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.
Tried the following solutions:
Wiped out the data from the Android emulator.
Make sure the emulator is connected to the internet.
cloud_firestore: ^3.1.15

Related

Flutter navigate HERE SDK crash

I am using the Flutter navigate SDK (The latest 4.12.7.0)
I'm getting this crash randomly. any guidance on how to fix or avoid?
34
[log] [WARN ] hf::navigation::lane_assistance - Could not fetch lanes: hf::navigation::ocm::Requested data could not be found in the map
libc++abi: terminating with uncaught exception of type std::bad_variant_access: bad_variant_access

Datastore to Firestore(datastore mode) automatic migration: request timeout while accessing datastore after REDIRECT_STRONGLY_CONSISTENT_READS step

I am using Objectify(v5) for accessing Datastore, in App Engine Standard Environment, with Java. Entities are cached by Objectify automatically, and I am also using Memcache separately.
This issue of Datastore APIs timing out started happening exactly post REDIRECT_STRONGLY_CONSISTENT_READS migration step. Strangely, it happens roughly after every hour or 2 hours, lasts for 3-4 mins and then gets back to normal. Since requests latency is going up from ~200ms to more than 60s, lots of new instances are getting created and am getting charged heavily.
here are some of the errors:
com.google.api.server.spi.SystemService invokeServiceMethod: exception occurred while calling backend method
java.util.concurrent.CancellationException: Task was cancelled.
at com.google.common.util.concurrent.AbstractFuture.cancellationExceptionWithCause(AbstractFuture.java:1550)
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:590)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:467)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:122)
at com.google.appengine.tools.development.TimedFuture.get(TimedFuture.java:55)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:68)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:89)
at com.google.appengine.api.datastore.Batcher$ReorderingMultiFuture.get(Batcher.java:114)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:89)
at com.googlecode.objectify.cache.TriggerFuture.get(TriggerFuture.java:100)
at com.googlecode.objectify.impl.ResultAdapter.now(ResultAdapter.java:34)
at com.googlecode.objectify.util.ResultWrapper.translate(ResultWrapper.java:22)
at com.googlecode.objectify.util.ResultWrapper.translate(ResultWrapper.java:10)
at com.googlecode.objectify.util.ResultTranslator.nowUncached(ResultTranslator.java:21)
at com.googlecode.objectify.util.ResultCache.now(ResultCache.java:30)
at com.googlecode.objectify.util.ResultWrapper.translate(ResultWrapper.java:22)
at com.googlecode.objectify.util.ResultWrapper.translate(ResultWrapper.java:10)
at com.googlecode.objectify.util.ResultTranslator.nowUncached(ResultTranslator.java:21)
at com.googlecode.objectify.util.ResultCache.now(ResultCache.java:30)
and
com.googlecode.objectify.cache.EntityMemcache getAll: Error obtaining cache for [<dummy-entity-name>]
java.util.concurrent.CancellationException: Task was cancelled.
and
java.lang.InterruptedException
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:460)
I have tried upgrading to latest versions:
implementation 'com.google.appengine:appengine-api-1.0-sdk:2.0.5'
implementation 'javax.servlet:javax.servlet-api:3.1.0'
implementation 'com.googlecode.objectify:objectify:5.1.25'
and also flushed memcache. nothing has worked.
Has anyone faced this issue?
It turned out to be an issue with migration itself. Reached out to Google Cloud support(paid), Datastore/Firestore Product team paused the migration, which I could not do it myself by the way, wasn't allowed for my project. They did some fixing and completed the migration. Now Datastore queries as running as expected.

Flutter in-app-purchase Android: Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0 error

I'm currently adding in-app purchase in my Flutter app. I have created a subscription on the Google Play Console and it is displayed on my app. I use Firebase's Cloud Functions as a way to validate users purchases and watch their status changes (canceled subscriptions, renewed subscriptions etc...) and Firebase's Firestore database to store the purchases and associate them with a specific user. When I try to verify a purchase is valid (by checking its availability in the store, checking if everything is fine with the data I send) the function returns false. By following the flow of the function I understood that it won't create new entry to the Firestore DB and that is returns false for that reason.
I get those warnings at the same time and they seem to be the reason for it :
W/DynamiteModule(17338): Local module descriptor class for providerinstaller not found.
I/DynamiteModule(17338): Considering local module providerinstaller:0 and remote module providerinstaller:0
W/ProviderInstaller(17338): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
I have found similar questions asked here but none of the answers fixed my issue.
I have tried to :
Add 'uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"' in my AndroidManifest.xml
Update my Google Services
Check thet I have enough storage left
Do a "flutter clean" and uninstall the app from my device before launching the app from Visual Code again.
I really don't know what to try now.

Flutter Firebase Crashlytics reports stack trace as Java class files and not as Dart files

I have integrated Flutter Crashlytics in our app, but it is reporting crashes stack trace in Java class files and not in Dart files. So it is difficult to infer what is the file and line number where this issue occurred in the flutter codebase.
Here is an example of one such crash report from Firebase Crashltytics of an Uncaught exception:
Non-fatal Exception: java.lang.Exception: NoSuchMethodError: The method 'markNeedsBuild' was called on null.
Receiver: null
Tried calling: markNeedsBuild()
at State.setState(State.java:1168)
at _ArgonButtonState.initState.<fn>(initState.java:107)
at AnimationLocalStatusListenersMixin.notifyStatusListeners(AnimationLocalStatusListenersMixin.java:193)
at AnimationController._checkStatusChanged(AnimationController.java:773)
at AnimationController._tick(AnimationController.java:789)
at Ticker._tick(Ticker.java:237)
at SchedulerBinding._invokeFrameCallback(SchedulerBinding.java:1102)
at SchedulerBinding.handleBeginFrame.<fn>(handleBeginFrame.java:1017)
at SchedulerBinding.handleBeginFrame(SchedulerBinding.java:1015)
at SchedulerBinding._handleBeginFrame(SchedulerBinding.java:949)
Here is how Crashlytics is initialized:
// Pass all uncaught errors from the framework to Crashlytics.
FlutterError.onError = Crashlytics.instance.recordFlutterError;
runZoned(() {
runApp(AppMain(homeWidget));
}, onError: Crashlytics.instance.recordError);
I am reporting caught exceptions as such:
Crashlytics.instance.recordError(error, stack);
How can I configure Crashlytics to report stack trace in dart? Does Crashlytics show erroneous file names and line numbers for Dart source code?
Todd from Crashlytics. This is a known behavior and we are looking into possible options moving forward. Kotlin users will see a similar behavior.
I would suggest to move on to Sentry.
I am doing it for my app now. And while just testing it, I can say that sentry is much better than Crashlytics!

Cloud Firestore with Angularfire 2 - Quota Error for retrieving large data

Whenever I try to retrieve large data from Firestore in my angular application, I get below error.
#firebase/firestore: Firestore (5.5.9): FirebaseError: [code=resource-exhausted]: Resource has been exhausted (e.g. check quota)
What can be done in this case? Once this error comes, Chrome browser tab also hangs. I have no option than to kill the browser. Moreover, if the same code is written in Python and run from PyCharm Community Edition, no such error is received.
However I need the data to be retrieved in my angular application. What can be done in this case?

Resources