Skip to content
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] Unhandled error Error read ECONNRESET after enabling 'preferRest' #2243

Closed
johnnyoshika opened this issue Jul 11, 2023 · 5 comments
Assignees

Comments

@johnnyoshika
Copy link

[REQUIRED] Step 2: Describe your environment

  • Operating System version: Linux
  • Firebase SDK version: [email protected]
  • 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,
});
@google-oss-bot
Copy link

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.

@johnnyoshika
Copy link
Author

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

image

@ehsannas
Copy link

tracking internally b/291972583

@sbhvt
Copy link

sbhvt commented Nov 13, 2023

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).

@ehsannas
Copy link

A common root cause of this error is that not all promises are awaited. In other words, there are background tasks that finish after the function loses CPU/Network access. See the "Do not start background activities" section.

If there's a more specific repro that you'd like me to investigate, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants