firebase / firebase-admin-node

Firebase Admin Node.js SDK

Home Page:https://firebase.google.com/docs/admin/setup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Firestore] Unhandled error Error read ECONNRESET after enabling 'preferRest'

johnnyoshika opened this issue · comments

[REQUIRED] Step 2: Describe your environment

  • Operating System version: Linux
  • Firebase SDK version: firebase-admin@11.9.0
  • Firebase Product: Firestore
  • Node.js version: 16
  • NPM version: 8.1.2

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Ever since I enabled preferRest:

const db = initializeFirestore(app, {
  preferRest: true,
});

...I've been getting many Unhandled error Error read ECONNRESET error notifications from Google Cloud. Here's a typical notification message:

image

Relevant Code:

const db = initializeFirestore(app, {
  preferRest: true,
});

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Here's another one with a different error message, but also only started appearing after enabling preferRest:

image

tracking internally b/291972583

We are also seeing lots of ECONNRESET since using rest. In our case, it is because the firebase functions are now setting FIRESTORE_PREFER_REST to true in environments which essentially turned this functionality on for us by default which caused us to get ECONNRESET errors across all of the functions which we recently deployed. I linked a new issue asking for guidance on this (see link to issue above in @google-cloud/firestore repo).