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

RST_STREAM error keeps showing up #1023

Open
jakeleventhal opened this issue Apr 16, 2020 · 166 comments
Open

RST_STREAM error keeps showing up #1023

jakeleventhal opened this issue Apr 16, 2020 · 166 comments
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@jakeleventhal
Copy link

Environment details

  • OS: macOS Catalina 10.15.5 Beta (19F53f)
  • Node.js version: 13.7.0
  • npm version: 6.13.6
  • @google-cloud/firestore version: 3.7.4

Steps to reproduce

This error keeps appearing over and over in my logs (not regularly reproducible):

Error: 13 INTERNAL: Received RST_STREAM with code 2
at Object.callErrorFromStatus (/api/node_modules/@grpc/grpc-js/src/call.ts:81)
at Object.onReceiveStatus (/api/node_modules/@grpc/grpc-js/src/client.ts:324)
at Object.onReceiveStatus (/api/node_modules/@grpc/grpc-js/src/client-interceptors.ts:439)
at Object.onReceiveStatus (/api/node_modules/@grpc/grpc-js/src/client-interceptors.ts:402)
at Http2CallStream.outputStatus (/api/node_modules/@grpc/grpc-js/src/call-stream.ts:228)
at Http2CallStream.maybeOutputStatus (/api/node_modules/@grpc/grpc-js/src/call-stream.ts:278)
at Http2CallStream.endCall (/api/node_modules/@grpc/grpc-js/src/call-stream.ts:262)
at ClientHttp2Stream.<anonymous> (/api/node_modules/@grpc/grpc-js/src/call-stream.ts:532)
at ClientHttp2Stream.emit (events.js:315)
at ClientHttp2Stream.EventEmitter.emit (domain.js:485)
at emitErrorCloseNT (internal/streams/destroy.js:76)
at processTicksAndRejections (internal/process/task_queues.js:84)
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Apr 16, 2020
@jakeleventhal jakeleventhal changed the title Bandwidth exhausted consistently showing up RST_STREAM error keeps showing up Apr 16, 2020
@bcoe bcoe added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Apr 16, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 17, 2020
@schmidt-sebastian
Copy link
Contributor

@jakeleventhal Thanks for filing this. Do you know at all what type of request/API call this is related to?

@jakeleventhal
Copy link
Author

The only place i use grpc is via firestore so it must be something from there. I don't really have more info unfortunately

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 21, 2020
@BenWhitehead BenWhitehead added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels May 8, 2020
@whyvrafvr
Copy link

I also got this one with firebase-admin 8.12.1 :

{"error":"Error: 13 INTERNAL: Received RST_STREAM with code 2
    at Object.callErrorFromStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call.js:30:26)
   at Object.onReceiveStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client.js:175:52)
    at Object.onReceiveStatus ...

@whyvrafvr
Copy link

This is a weird jeopardize issue, thrown during delete as create or whatever request type...

@schmidt-sebastian
Copy link
Contributor

All document modifications (e.g. delete(), create()) use the same underlying request type. This request type is not safe for automatic retry, so unfortunately we cannot simply retry these errors.

@whyvrafvr
Copy link

whyvrafvr commented May 20, 2020

Hi @schmidt-sebastian.
I do confirm the request type is not safe.
Retrying many times the same call (and so, the same request, I guess) has no significant effect.
But there is no error when the nodejs instance is restarted : I guess a GRPC subroutine is hanging out.

@whyvrafvr
Copy link

After a while, errors, as mentioned by @jakeleventhal, are thrown and it’s not possible to persist data in firestore and an instance restart is required. That’s a real problem folks 😄
FYI, I’ve no issue using firestore delete(), create() methods with Go...

@schmidt-sebastian
Copy link
Contributor

schmidt-sebastian commented May 20, 2020

@Skonx To rule out that this is a problem with our backend, can you send me your project ID and the time at which you saw these repeated failures? My email is mrschmidt<at>google.com.

If it is not a backend issue, we likely need GRPC logs from to further diagnose these failures. These can be obtained by setting two environment variables: GRPC_TRACE=all, GRPC_VERBOSITY=DEBUG

Note that this create a lot of logs, so hopefully this is not something we have to look at.

@whyvrafvr
Copy link

whyvrafvr commented May 20, 2020

Yep. I've replied to your google.com email address.
I will enable the environment variables asap and keep you post.

@ConorEB
Copy link

ConorEB commented May 26, 2020

Hello! We also experience the same error usually coupled with
Error: 8 RESOURCE_EXHAUSTED: Bandwidth exhausted

We noticed that it usually fails all at once and then recovers very quickly.

@sk-
Copy link
Contributor

sk- commented May 26, 2020

We are also affected by this error. A month before, it was a sporadic error, maybe once a week, and now we are seeing it many times per day.

@merlinnot
Copy link

I'm also experiencing the issue for over a month now, with a couple hundred to a few thousand errors per day:

  • Error: 13 INTERNAL: Received RST_STREAM with code 2
  • Error: 14 UNAVAILABLE: Stream refused by server

@schmidt-sebastian I opened a support case if you need a project ID or other information: 23689958.

@zenati
Copy link

zenati commented May 29, 2020

Same problem here: Received RST_STREAM with code 2

@ConorEB
Copy link

ConorEB commented May 29, 2020

We were able to resolve the Error: 8 RESOURCE_EXHAUSTED: Bandwidth exhausted by upgrading to a nodejs12 runtime on App Engine and updating Electron to the newly released v9 version. So far we have not seen it again in production since the root cause was related to the node js patch:
https://nodejs.org/en/blog/release/v12.14.1/

[9fd6b5e98b] - http2: fix session memory accounting after pausing (Michael Lehenbauer) #30684

After the update, the various other DB related errors have also gone away, including Received RST_STREAM with code 2.

We currently use Electron in a Google App Engine project and work in the standard runtime. Google has not updated its images to include some necessary libs for the new version of Electron. We were able to work around this as Google supports these libs in Puppeteer, so we installed Puppeteer and sent a deploy off to our production server (on a no-promote flag). After doing so, our best guess is that Google rebuilt our server images with the needed libs to run Puppeteer, which in turn allowed us to run the new version of Electron.

I hope this information helps! We spent a lot of time diving into this, so if you have any questions, feel free to respond below.

@schmidt-sebastian
Copy link
Contributor

schmidt-sebastian commented May 30, 2020

Our backend team has looked at the projects that were sent to us. There are no indications that your errors correlate with errors on the backend, which makes it likely that this is a client side issue. I will continue to investigate possible root causes.

@schmidt-sebastian
Copy link
Contributor

As of v3.8.5, we are now retrying RunQuery requests that fail with RST_STREAM. If this error shows up again, we can evaluate expanding our retry to other SDK methods as well.

@merlinnot
Copy link

@schmidt-sebastian I've been running on v3.8.5 for the entire day, I still see RST_STREAM.

I checked my code to see for which usage patterns does it occur:

  • await reference.set()
  • await batch.commit()
  • await reference.update()

Can we please reopen this issue for visibility?

@schmidt-sebastian
Copy link
Contributor

@merlinnot We continue to receive pushback on retrying RST_STREAM/INTERNAL for Commit RPCs. I hope your comment is enough to convince the respective folks that we should retry.

@FilledStacks
Copy link

I just finished my backend local development and everything work well. Then I deployed and none of my functions work. I'm getting the same error.

Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: Protocol error
    at callErrorFromStatus (/workspace/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:192:76)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
    at /workspace/node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

My code is pretty simple.

this.#log.i(`create license`, JSON.stringify({license: license, id: id}));

const licenseDoc = this.ref.doc(id);

await licenseDoc.set(license); // <===== This is where the error originates from 
return licenseDoc.id;

Using Node.js 16

I don't get it once or twice, it literally happens everytime. My endpoint doesn't work at all. This is a brand new project on Firestore and my first deployment.

Package.json dependencies

 "dependencies": {
    "firebase-admin": "^11.10.1",
    "firebase-backend": "^0.2.5",
    "firebase-functions": "^4.4.1",
    "uuid": "^9.0.1"
  },

Is there anything I can try to get past this? We need to launch our product and I'd hate to need another week to rewrite all these endpoints on a different platform.

@maylorsan
Copy link

maylorsan commented Oct 21, 2023

👋 @schmidt-sebastian,

We've been facing this error in our production environment for the past 3 days and it's occurred roughly 10,600 times:

Error: 13 INTERNAL: Received RST_STREAM with code 1

image

The error is triggered when executing the following code:

const writeResult = await admin
      .firestore()
      .collection(FirestoreCollections.Users)
      .doc(userID)
      .update(fieldsToUpdate); // This line throws the error

Do we have any updates or workarounds for this? It's affecting our users and we'd appreciate your guidance.

Note: Our Users collection has a significantly large number of documents. Could the volume of documents be a contributing factor to this issue?

@CollinsVizion35
Copy link

CollinsVizion35 commented Oct 22, 2023

@maylorsan

13 INTERNAL: Received RST_STREAM with code 2

Have you found a solution to this? because i am facing the same exact error.

@maylorsan
Copy link

Hello @CollinsVizion35,

We haven't found a solution to this issue yet.

We've attempted several methods, but none have resolved the problem:

  • Switched the update method to use set and set with {merge: true}, but this didn't work.
  • Created a new cloud function dedicated solely to this method. Surprisingly, it didn't work either. However, it's noteworthy that we have several other cloud functions that update user data using the same method, and they function as expected.
    What's even more perplexing is that this issue arises in about 60% of our http cloud function calls, and it seems to occur randomly. We haven't been able to identify a consistent pattern.

Interestingly, everything operates flawlessly in our development project. The only difference is that the development project has a smaller User collection.

I'm starting to suspect that this might be related to some undocumented limitation in Firestore...

I will stay in touch about updates!

@CollinsVizion35
Copy link

CollinsVizion35 commented Oct 22, 2023

@maylorsan

Okay, thank you. I tried using batch commit and it still didn't work.

@edmilsonss
Copy link

I've got a workaround/solution in my situation

See here: firebase/firebase-admin-node#2345 (comment)

@CollinsVizion35
Copy link

CollinsVizion35 commented Oct 24, 2023

Hey @maylorsan, i think i have found a solution from @edmilsonss

I think it works with these changes

former code:
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://project name.firestore.googleapis.com",
});

// Create a Firestore instance
const db = admin.firestore();

new code:
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://project name.firestore.googleapis.com",
});

// Create a Firestore instance
const db = admin.firestore();
const settings = {
preferRest: true,
timestampsInSnapshots: true
};
db.settings(settings);

@maylorsan
Copy link

maylorsan commented Oct 24, 2023

@CollinsVizion35 Indeed, we haven't experimented with that solution just yet. As I mentioned in this comment, our primary approach was to optimize our algorithm logic between Firebase calls. Thankfully, this seems to have resolved the issue for now.

It's certainly an unusual behavior 😄

@udnes99
Copy link

udnes99 commented Nov 6, 2023

Any update on this issue? Happens sporadically for us in production, using @google-cloud/datastore": "8.2.2" and as I understood, googleapis/nodejs-datastore#679 has been closed in favor of using this issue as it is likely the same root cause. This has been happening for a long time..

This seems to be occurring when instantiating too many transactions simultaneously, perhaps it initiates too many gRPC connections to the google API?

@sammyKhan
Copy link

@maylorsan Setting preferRest: true fixes it for one of our simpler services, but not for others. We are not using firestore listeners in any of them, so I'm surprised it's switching to http streaming from REST at all. Could you give a list of situations in which preferRest will fall back to http streaming so that we can try to avoid them?

@maylorsan
Copy link

maylorsan commented Dec 5, 2023

@sammyKhan, my apologies for the delayed reply!

I wanted to clarify that we don't employ preferRest: true in our services, as previously mentioned. Our main strategy has been to refine the logic of our algorithm, especially in the intervals between Firebase calls.

our primary approach was to optimize our algorithm logic between Firebase calls

In our case it appears that the issue we're encountering arises due to a significant delay occurring between the get and update methods in Firestore.

@cherylEnkidu
Copy link
Contributor

Hi @maylorsan

Since your case is different to what is been reported in this issue, could you please open a new ticket and describe your problem in detail?

@maylorsan
Copy link

Hi @cherylEnkidu,

Thanks for the advice. I'll open a new ticket with all relevant details to address our specific Firestore issue.

@adamkoch
Copy link

We still see this intermittently, no real pattern that I can see. The Firestore code that triggers it is simple and runs successfully 99% of the time:

await ref.set(updateData, {
  merge: true,
});

But every so often we'll see the error. I've been progressively adding more debugging logging to the function to see if I can work out what may be causing it but there is nothing of note that I can see.

Using up-to-date dependencies and node version.

~/ $ node --version
v18.18.2

package.json dependencies:

  "dependencies": {
    "@google-cloud/firestore": "^7.3.0",
    "@google-cloud/logging": "^11.0.0",
    "firebase-admin": "^12.0.0",
    "firebase-functions": "^4.7.0",
    "googleapis": "^132.0.0",
    ...
  },

Stack trace:

Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)
    at callErrorFromStatus (/workspace/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:192:76)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
    at /workspace/node_modules/@grpc/grpc-js/build/src/resolving-call.js:99:78
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
for call at
    at ServiceClientImpl.makeUnaryRequest (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:160:32)
    at ServiceClientImpl.<anonymous> (/workspace/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
    at /workspace/node_modules/@google-cloud/firestore/build/src/v1/firestore_client.js:231:29
    at /workspace/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
    at repeat (/workspace/node_modules/google-gax/build/src/normalCalls/retries.js:80:25)
    at /workspace/node_modules/google-gax/build/src/normalCalls/retries.js:118:13
    at OngoingCallPromise.call (/workspace/node_modules/google-gax/build/src/call.js:67:27)
    at NormalApiCaller.call (/workspace/node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19)
    at /workspace/node_modules/google-gax/build/src/createApiCall.js:84:30
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Caused by: Error
    at WriteBatch.commit (/workspace/node_modules/@google-cloud/firestore/build/src/write-batch.js:432:23)
    at DocumentReference.set (/workspace/node_modules/@google-cloud/firestore/build/src/reference.js:398:27)
    at /workspace/lib/auth.js:201:19
    at Generator.next (<anonymous>)
    at fulfilled (/workspace/lib/auth.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 13,
  details: 'Received RST_STREAM with code 2 (Internal server error)',
  metadata: Metadata { internalRepr: Map(0) {}, options: {} },
  note: 'Exception occurred in retry method that was not classified as transient'
}
    at console.error (/workspace/node_modules/firebase-functions/lib/logger/compat.js:31:23)
    at /workspace/lib/auth.js:207:17
    at Generator.throw (<anonymous>)
    at rejected (/workspace/lib/auth.js:6:65)

@adi-rds
Copy link

adi-rds commented Mar 1, 2024 via email

@looker-colmeia
Copy link

looker-colmeia commented Apr 30, 2024

any news on this issue? 2 years with the same problem here at the company, we tried

const datastore = new Datastore({fallback:'rest'});

but it's too slow

@BrodaNoel
Copy link

BrodaNoel commented May 23, 2024

I think I have some information here that could help to find the reason behind this error.

This is the error I'm getting: Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error). (I'm coming here from this issue: googleapis/nodejs-datastore#679)

First, some context:

I have a website that tracks an "photo was opened" event.
For example, if you open this url: https://getnofilter.com/es/spot/horrea-vespasiani-from-teatro-del-fontanone-in-italy if you check the network tab, you'll see that I'm calling trackUser sending the event spot-opened, with the spotId, and the userId.

What I'm doing here, is just to do and increment in the spots-viewed for that user.
You see that some times you receive some emails at the end of the month with stats of how many people saw your profile, or your photos? Well.. It's basically that.

So, the backend has a really weird and ugly code like this:

      newData[`${date}.events`] = FieldValue.increment(1);

      if (type === 'profile-view') {
        newData[`${date}.profile.views`] = FieldValue.increment(1);
      } else if (type === 'spot-open') {
        newData[`${date}.spots.${spotId}.opens`] = FieldValue.increment(1);
      }

      try {
        const response = await firestore.collection('userStats').doc(userId).update(newData);// <<<<< HERE IS WHERE IT FAILS
      } catch (error) {
        errors.report(
          new Error(
            `EDIT ERROR ${error.message}. userId:${userId}. type:${type}. spotid:${spotId}. ip:${ip}`
          )
        );
        errors.report(error);
      }

Now, the possible root of the problem:

Have you seen that errors.report? Well... Let me show you the logs of those errors:

Screen Shot 2024-05-24 at 01 45 55

Pay attention to the "IP": Error: EDIT ERROR 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error). userId:eb91c63b-92ef-4a02-b2ba-03a69d298392. type:spot-open. spotid:4a5bcd81-fafb-412b-b0a5-663fdacbe3c4. ip:66.249.66.203

That's a Google Bot IP.
I've been watching it close, and seems like 90% of these errors comes when Google Bot is opening the website.
So... What I am thinking now, is that MAYBE Google Bot is loading THE SAME URL in multiples devices at the same time (for desktop, tablet, mobile crawling), and thus, I'm calling too soon the "update" action over the same doc id, which end up in an error

I remember having this problem around 2 years ago, where I was calling the update function in a doc id too soon, getting some exceptions, but the message of those errors was another one.

Anyways... I hope it helps.

@BrodaNoel
Copy link

I have a question for everyone having this same issue:

Are you all getting this error while calling the update, using a FieldValue.increment(1); value on the new data?

I am getting this error ONLY in a update call where I'm using FieldValue.increment(1); 2 times in the new data.

@neilpatrickadams
Copy link

neilpatrickadams commented May 24, 2024

I have a question for everyone having this same issue:

Are you all getting this error while calling the update, using a FieldValue.increment(1); value on the new data?

I am getting this error ONLY in a update call where I'm using FieldValue.increment(1); 2 times in the new data.

Yes that's where I'm seeing it. update() with a single admin.firestore.FieldValue.increment(1) (along with a few other numbers and strings in the same update.).

I've been seeing this for years now and when it does happen my app performs poorly as a result. So hopefully this will help lead to a solution!

@adamkoch
Copy link

I'm not using FieldValue.increment() but I am using FieldValue.serverTimestamp() in my update call.

@BrodaNoel
Copy link

In my case I only see it on functions using NodeJS 18, or 20. It works perfectly on NodeJS 16.

@BrodaNoel
Copy link

BrodaNoel commented May 24, 2024

I moved from 1st Generation to 2nd Generation hopping to find a fix, but still there.

Screen Shot 2024-05-24 at 03 33 47

@MorenoMdz
Copy link

We had millions of these errors last year, they were all caused by the snapshot listeners, we solved it by moving off Firestore lol

@looker-colmeia
Copy link

hello, any news on this issue???

@Jhon-Idrovo
Copy link

Hello. I'm having this issue only on production. It works fine with emulators locally.
Using:
"firebase-admin": "^12.2.0",
and all I'm doing is retrieving data from firebase
This is my initialization

import admin from "firebase-admin";

const serviceAccount = require("PATH-TO-SERVICE-ACCOUNT.json");

export const app = admin.initializeApp({
    credential: admin.credential.cert(serviceAccount),
    databaseURL: "PROJECT-ID.firebaseio.com", // Replace with your project ID
});

export const db = admin.firestore();
// Configure Firestore to use the local emulator
if (process.env.NODE_ENV !== "production")
    db.settings({
        host: "localhost:8080",
        ssl: false,
        ignoreUndefinedProperties: true,
    });
else
    db.settings({
        ignoreUndefinedProperties: true,
    });

and when retrieving the data I do:

const getAttendingHoursForUser = async (args: { uid: string }) => {
    const user = (await db.doc(`users/${args.uid}`).get()).data();

    return user.attendingHours as AttendingHour[];
};

Error stacktrace:

Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: Protocol error
    at callErrorFromStatus (/app/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client.js:358:73)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
    at /app/node_modules/@grpc/grpc-js/build/src/resolving-call.js:129:78
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

@Jhon-Idrovo
Copy link

FIXED: While I was looking at the files I noticed the env variable NODE_ENV was unset. So I was trying to reach the emulator instead of the production DB. So if you're having this issue, check what you're connecting to

@leeyongeun9
Copy link

leeyongeun9 commented Nov 28, 2024

Is there any update or progress regarding this issue? In my case, I encounter this problem frequently (~ 30 times per day) across various parts of my project where the reference.update() function is called. These errors pose a significant risk to my service, as they can lead to data inconsistencies.

Below are logs from a single day, each occurring at different points in the code:

Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)
    at callErrorFromStatus (/workspace/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:193:76)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
    at /workspace/node_modules/@grpc/grpc-js/build/src/resolving-call.js:129:78
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
for call at
    at ServiceClientImpl.makeUnaryRequest (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:161:32)
    at ServiceClientImpl.<anonymous> (/workspace/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
    at /workspace/node_modules/@google-cloud/firestore/build/src/v1/firestore_client.js:237:29
    at /workspace/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
    at repeat (/workspace/node_modules/google-gax/build/src/normalCalls/retries.js:82:25)
    at /workspace/node_modules/google-gax/build/src/normalCalls/retries.js:125:13
    at OngoingCallPromise.call (/workspace/node_modules/google-gax/build/src/call.js:67:27)
    at NormalApiCaller.call (/workspace/node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19)
    at /workspace/node_modules/google-gax/build/src/createApiCall.js:112:30
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Caused by: Error
    at _firestore._traceUtil.startActiveSpan (/workspace/node_modules/@google-cloud/firestore/build/src/write-batch.js:438:27)
    at DisabledTraceUtil.startActiveSpan (/workspace/node_modules/@google-cloud/firestore/build/src/telemetry/disabled-trace-util.js:16:16)
    at WriteBatch.commit (/workspace/node_modules/@google-cloud/firestore/build/src/write-batch.js:436:43)
    at /workspace/node_modules/@google-cloud/firestore/build/src/reference/document-reference.js:396:18
    at DisabledTraceUtil.startActiveSpan (/workspace/node_modules/@google-cloud/firestore/build/src/telemetry/disabled-trace-util.js:16:16)
    at DocumentReference.update (/workspace/node_modules/@google-cloud/firestore/build/src/reference/document-reference.js:390:43)
    at addChatDetailToReservationIfNeeded (/workspace/index.js:1819:6)
    at /workspace/index.js:1470:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Unhandled error Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)
    ... duplicate lines
    ...
Caused by: Error
    ...
    ...
    at DocumentReference.update (/workspace/node_modules/@google-cloud/firestore/build/src/reference/document-reference.js:390:43)
    at /workspace/index.js:4901:10
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /workspace/node_modules/firebase-functions/lib/common/providers/tasks.js:83:17 {
  code: 13,
  details: 'Received RST_STREAM with code 2 (Internal server error)',
  metadata: Metadata { internalRepr: Map(0) {}, options: {} },
  note: 'Exception occurred in retry method that was not classified as transient'
}
Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)
    ... duplicate lines
    ...
Caused by: Error
    ...
    ...
    at DocumentReference.update (/workspace/node_modules/@google-cloud/firestore/build/src/reference/document-reference.js:390:43)
    at updateChatWithReservationUpdate (/workspace/index.js:1794:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)
    ...
    ...
Caused by: Error
    at _firestore._traceUtil.startActiveSpan (/workspace/node_modules/@google-cloud/firestore/build/src/write-batch.js:438:27)
    at DisabledTraceUtil.startActiveSpan (/workspace/node_modules/@google-cloud/firestore/build/src/telemetry/disabled-trace-util.js:16:16)
    at WriteBatch.commit (/workspace/node_modules/@google-cloud/firestore/build/src/write-batch.js:436:43)
    at updateChatlogData (/workspace/index.js:5597:25)
    at /workspace/index.js:3194:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@BrodaNoel
Copy link

I never got this issue again. Are you sure you are in the latest version of all the dependencies?

@leeyongeun9
Copy link

leeyongeun9 commented Nov 30, 2024

I never got this issue again. Are you sure you are in the latest version of all the dependencies?

Yes I updated all the dependencies and deplyed the functions after I wrote the reply but the errors still occured

Environment Details

  • node : v20.9.0
  • npm : 10.1.0
  • firebase-admin : 13.0.1
  • firebase-functions : 6.1.1
  • @google-cloud/firestore : 7.10.0

@snallapa
Copy link

running into this as well when doing a rather heavy migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests