Skip to content

cloud_firestore: ^3.1.9 - The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff #3624

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

Closed
swarupa-v opened this issue Apr 7, 2022 · 7 comments

Comments

@swarupa-v
Copy link

I am trying to fetch data from firestore cache in my flutter application and I get the following error.
The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.
This is not happening consistently and happens only when offline and fetching data from cache.

Any help will be appreciated.

Flutter version details:
Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7e9793dee1 (5 weeks ago) • 2022-03-02 11:23:12 -0600
Engine • revision bd539267b4
Tools • Dart 2.16.1 • DevTools 2.9.2

@google-oss-bot
Copy link
Contributor

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

@cherylEnkidu
Copy link
Contributor

Hi swarupa-v, in order to better assist you, could you please provide a minimum repro app together with instructions for reproducing the bug? Also, it will be helpful if you can enable the debug logging and provide us some logs :)

@cherylEnkidu cherylEnkidu self-assigned this Apr 7, 2022
@swarupa-v
Copy link
Author

I have a firebase query that is fetching data :
Source source = Source.cache;
var collection = _firestoreInstance!.collection('Checklist');

var docSnapshot = await collection.doc(id).get(GetOptions(source: source));

Following is the debug log:
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.
E/flutter (18630): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607)
E/flutter (18630): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177)
E/flutter (18630):
E/flutter (18630): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:377)
E/flutter (18630):
E/flutter (18630): #3 MethodChannelDocumentReference.get (package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:68)
E/flutter (18630):
E/flutter (18630): #4 _JsonDocumentReference.get (package:cloud_firestore/src/document_reference.dart:146)
E/flutter (18630):
E/flutter (18630): #5 FirestoreService.getChecklist (package:riskmemo/services/firestoreservice.dart:1206)
E/flutter (18630):
E/flutter (18630): #6 TemplateSectionsPageState.getTemplateSections (package:riskmemo/pages/templates/templatesectionlist.dart:417)
E/flutter (18630):
E/flutter (18630):
E/flutter (18630): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] 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.
E/flutter (18630): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607)
E/flutter (18630): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177)
E/flutter (18630):
E/flutter (18630): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:377)
E/flutter (18630):
E/flutter (18630): #3 MethodChannelDocumentReference.get (package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:68)
E/flutter (18630):
E/flutter (18630): #4 _JsonDocumentReference.get (package:cloud_firestore/src/document_reference.dart:146)
E/flutter (18630):
E/flutter (18630): #5 FirestoreService.updateTagsOfCompany (package:riskmemo/services/firestoreservice.dart:1019)
E/flutter (18630):
E/flutter (18630):

@cherylEnkidu
Copy link
Contributor

Hi swarupa-v,
The logs you currently provide is not so helpful. You probably need to enable Firestore debug logging by calling setLoggingEnabled.

@swarupa-v
Copy link
Author

This option setLoggingEnabled we did not find in Flutter. Any suggestion from your end would be helpful.

@cherylEnkidu
Copy link
Contributor

Hi swarupa-v,
Unfortunately my team doesn’t know much about Flutter. What I can suggest is posting your issue in https://github.com/firebase/flutterfire, some experts there might be able to give you some help :)

@cherylEnkidu
Copy link
Contributor

Also you cannot connect to the backend during offline. So another thing you can try is, when fetching data during offline, specify {source: cache} or whatever Flutter equivalent is.

@firebase firebase locked and limited conversation to collaborators May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants