5

My ReactJs web app with firebase was working perfectly fine and I was able to fetch the entries from the collection and display it in my webapp but when I tried running the app next day, everything seemed to have crashed. I wasn't able to fetch the documents. I've attached a detailed log below:

[2020-08-08T09:09:13.740Z]  @firebase/firestore: Firestore (7.17.2): FirestoreClient Initializing. user= null
logger.ts:115 [2020-08-08T09:09:13.746Z]  @firebase/firestore: Firestore (7.17.2): MemoryPersistence Starting transaction: Get next mutation batch
logger.ts:115 [2020-08-08T09:09:13.752Z]  @firebase/firestore: Firestore (7.17.2): MemoryPersistence Starting transaction: Get next mutation batch
logger.ts:115 [2020-08-08T09:09:13.759Z]  @firebase/firestore: Firestore (7.17.2): MemoryPersistence Starting transaction: Allocate target
logger.ts:115 [2020-08-08T09:09:13.762Z]  @firebase/firestore: Firestore (7.17.2): MemoryPersistence Starting transaction: Execute query
logger.ts:115 [2020-08-08T09:09:13.768Z]  @firebase/firestore: Firestore (7.17.2): IndexFreeQueryEngine Using full collection scan to execute query: Query(target=Target(posts, orderBy: [__name__ (asc)]); limitType=F)
logger.ts:115 [2020-08-08T09:09:13.776Z]  @firebase/firestore: Firestore (7.17.2): Connection Creating WebChannel: https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel {"httpSessionIdParam":"gsessionid","initMessageHeaders":{"X-Goog-Api-Client":"gl-js/ fire/7.17.2","Content-Type":"text/plain"},"messageUrlParams":{"database":"projects/instagram-clone-fa27a/databases/(default)"},"sendRawJson":true,"supportsCrossDomainXhr":true,"internalChannelParams":{"forwardChannelRequestTimeoutMs":600000},"forceLongPolling":false,"httpHeadersOverwriteParam":"$httpHeaders"}
logger.ts:115 [2020-08-08T09:09:13.843Z]  @firebase/firestore: Firestore (7.17.2): Connection Opening WebChannel transport.
logger.ts:115 [2020-08-08T09:09:13.847Z]  @firebase/firestore: Firestore (7.17.2): Connection WebChannel sending: {"database":"projects/instagram-clone-fa27a/databases/(default)","addTarget":{"query":{"structuredQuery":{"from":[{"collectionId":"posts"}],"orderBy":[{"field":{"fieldPath":"__name__"},"direction":"ASCENDING"}]},"parent":"projects/instagram-clone-fa27a/databases/(default)/documents"},"targetId":2}}
index.js:1 [2020-08-08T09:09:23.776Z]  @firebase/firestore: Firestore (7.17.2): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.


This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
    [2020-08-08T09:09:24.918Z]  @firebase/firestore: Firestore (7.17.2): PersistentStream close with error: FirebaseError: [code=unavailable]: The operation could not be completed
    logger.ts:115 [2020-08-08T09:09:24.924Z]  @firebase/firestore: Firestore (7.17.2): OnlineStateTracker Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=unavailable]: The operation could not be completed
    This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

I've a perfectly fine working internet connection and I'm sure internet is not the issue. Can somebody please suggest me a workaround solution for the same? It'd be of great help.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Aroj Subedi
  • 51
  • 2
  • 5
  • Are you sure this isn't a firewall issue? Have you tried disabling your firewall/antivirus and trying again? – JayCodist Aug 08 '20 at 14:15
  • I've now disabled Firewall & Network protection and Virus and threat protection as well and restarted my system but It's still shows the same issue in the console. – Aroj Subedi Aug 08 '20 at 14:44
  • On the firebase console: https://console.firebase.google.com/, in the database section, and under Rules tab, can you check for your current security rules setting? Is it set to test mode? – JayCodist Aug 08 '20 at 14:53
  • I've following section in the Rules tab. rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if request.time < timestamp.date(2020, 9, 7); } } } – Aroj Subedi Aug 08 '20 at 15:25
  • What version of firebase are you using? Also, take a look at some of the solutions here: https://stackoverflow.com/questions/61029193/error-when-connecting-to-firebase-firestore-could-not-reach-cloud-firestore-bac?rq=1 – JayCodist Aug 08 '20 at 15:50
  • Firebase version 7.17.2. I've tried all of those but sadly none of them seem to be working for me. – Aroj Subedi Aug 08 '20 at 16:03
  • Do you have something specific you’d like to do with Firebase-related tasks using the API? – MrTech Aug 15 '20 at 00:38
  • Perhaps you may look at this document. It suggests some options you can try. https://stackoverflow.com/questions/50674482/firebase-firestore-firestore-5-0-4-could-not-reach-cloud-firestore-backend – MrTech Aug 21 '20 at 00:39

0 Answers0