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

Error: 13 INTERNAL: Received RST_STREAM with code 2 #679

Closed
SUM-Soft opened this issue Jun 10, 2020 · 29 comments
Closed

Error: 13 INTERNAL: Received RST_STREAM with code 2 #679

SUM-Soft opened this issue Jun 10, 2020 · 29 comments
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. external This issue is blocked on a bug with the actual product. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@SUM-Soft
Copy link

Hi!

Getting the following error periodically (1-2 times a day)

A 2020-06-10T18:35:53.594123Z (node:14) UnhandledPromiseRejectionWarning: Error: 13 INTERNAL: Received RST_STREAM with code 2 
A 2020-06-10T18:35:53.594173Z     at Object.callErrorFromStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call.js:30:26) 
A 2020-06-10T18:35:53.594187Z     at Object.onReceiveStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client.js:175:52) 
A 2020-06-10T18:35:53.594267Z     at Object.onReceiveStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:341:141) 
A 2020-06-10T18:35:53.594293Z     at Object.onReceiveStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:304:181) 
A 2020-06-10T18:35:53.594306Z     at Http2CallStream.outputStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:116:74) 
A 2020-06-10T18:35:53.594318Z     at Http2CallStream.maybeOutputStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:155:22) 
A 2020-06-10T18:35:53.594330Z     at Http2CallStream.endCall (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:141:18) 
A 2020-06-10T18:35:53.594342Z     at ClientHttp2Stream.<anonymous> (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:403:22) 
A 2020-06-10T18:35:53.594356Z     at ClientHttp2Stream.emit (events.js:315:20) 
A 2020-06-10T18:35:53.594367Z     at emitCloseNT (internal/streams/destroy.js:69:8) 
A 2020-06-10T18:35:53.594394Z (node:14) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) 
A 2020-06-10T18:35:53.594405Z (node:14) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 
A 2020-06-10T18:35:54.059739Z 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 (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:341:141)
    at Object.onReceiveStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:304:181)
    at Http2CallStream.outputStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:116:74)
    at Http2CallStream.maybeOutputStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:155:22)
    at Http2CallStream.endCall (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:141:18)
    at ClientHttp2Stream.<anonymous> (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:403:22)
    at ClientHttp2Stream.emit (events.js:315:20)
    at emitCloseNT (internal/streams/destroy.js:69:8) { 
A 2020-06-10T18:35:54.059769Z   code: 13, 
A 2020-06-10T18:35:54.059794Z   details: 'Received RST_STREAM with code 2', 
A 2020-06-10T18:35:54.059803Z   metadata: Metadata { internalRepr: Map {}, options: {} }, 
A 2020-06-10T18:35:54.059813Z   note: 'Exception occurred in retry method that was not classified as transient' 
A 2020-06-10T18:35:54.059821Z }

Environment details

  • OS: Cloud Run
  • Node.js version: node:lts-slim
  • npm version: 6.14.5
  • @google-cloud/datastore version: 6.0.0

Thanks!

@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/nodejs-datastore API. label Jun 10, 2020
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jun 11, 2020
@BenWhitehead BenWhitehead added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Jun 15, 2020
@BenWhitehead
Copy link
Contributor

@schmidt-sebastian Does this look like the same error we're seeing in Firestore?

@BenWhitehead
Copy link
Contributor

@SUM-Soft Can you confirm if you're using Cloud Datastore or Cloud Firestore in Datastore Mode?

@schmidt-sebastian
Copy link

It would shock me if this wasn't the exact same as googleapis/nodejs-firestore#1023

@SUM-Soft
Copy link
Author

@SUM-Soft Can you confirm if you're using Cloud Datastore or Cloud Firestore in Datastore Mode?

Using Cloud Firestore in Datastore mode

@mdobson
Copy link

mdobson commented Jul 9, 2020

We see this issue in using Cloud Datastore within Cloud Run as well.

@radvansky-tomas
Copy link

I am seeing this constantly now...every time I am trying to write object to newly created collection (from auth trigger in firebase cloud functions).

@damienromito
Copy link

I got this on OnDelete triggers

Yesterday
Screen Shot 2020-07-12 at 18 33 07

Today
Screen Shot 2020-07-12 at 18 32 16
Screen Shot 2020-07-12 at 18 32 38

@rdev-software
Copy link

Show how you configure your admin app, if you dont have same issue as above

@SUM-Soft
Copy link
Author

The error still occurs with @google-cloud/datastore version: 6.1.0
Any progress on this issue?

@zdenda-online
Copy link

We see the same. It usually happens for us when we do quite a heavy load of database writes in Node.js GCP function (nodejs10) during the migration of data. I tried to "relax" the calls putting random 1-20ms "sleep" in between writes but it did not help.

And yes, we are using Datastore in Firestore mode. Datastore client libraries version 6.2.0.

Any progress on this?

@biendinh
Copy link

Same here on firebase function.
Db: Cloud Firestore
Screenshot from 2020-10-26 16-09-06

@jhcordeiro
Copy link

Firebase functions with Node 10:

Error message:
2020-10-30 13:09:54.340 EDT 6trbr5cj3lf7 Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) at Object.callErrorFromStatus (/workspace/node_modules/@grpc/grpc-js/build/src/call.js:31:26) at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:327:49) at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:305:181) at process.nextTick (/workspace/node_modules/@grpc/grpc-js/build/src/call-stream.js:124:78) at process._tickCallback (internal/process/next_tick.js:61:11)

Please, is there any progress with this issue? all my function calls started failing after 9:10am PST today

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Dec 7, 2020
@eli-stewart
Copy link

eli-stewart commented Dec 10, 2020

I am seeing this as well. I am running a Typescript React App with a node.js server. The server is throwing this error fairly regularly. Something like once an hour. I also get this similar error: @firebase/firestore: Firestore (7.19.1): Connection GRPC stream error. Code: 14 Message: 14 UNAVAILABLE: Stream refused by server but about 20% as frequently.

I had a crash on my site on Monday where I was not able to read or write the database and I am trying to figure out if its related.

These are the 3 types of errors I am receiving of this type:
@firebase/firestore: Firestore (7.19.1): Connection GRPC stream error. Code: 13 Message: 13 INTERNAL: Received RST_STREAM with code 2

@firebase/firestore: Firestore (7.19.1): Connection GRPC stream error. Code: 14 Message: 14 UNAVAILABLE: Stream refused by server

@firebase/firestore: Firestore (7.19.1): Connection GRPC stream error. Code: 13 Message: 13 INTERNAL: Received RST_STREAM with code 0

@zdenda-online
Copy link

Any update?

By the way, I don't agree this should have priority p2 = moderate importance. This breaks the base use of the service.

@schmidt-sebastian
Copy link

We are working on this with multiple engineers and trying to come with mitigation strategies. Unfortunately, this is more difficult than anticipated.

@zdenda-online
Copy link

@schmidt-sebastian ok thanks for the info. Good luck with that :-) Was unsure as I see Open bug with no assignee.

@binajmen
Copy link

binajmen commented Feb 24, 2021

Thank you @schmidt-sebastian for the follow up.

Please keep us in the loop when things are moving. I'm having the same issue with Cloud Run + Firestore.

Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: Protocol error
    at Object.callErrorFromStatus (/app/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client.js:327:49)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /app/node_modules/@grpc/grpc-js/build/src/call-stream.js:130:78
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

@kickbk
Copy link

kickbk commented Mar 1, 2021

Same issue here. Waiting for this to be resolved.

@tohagan
Copy link

tohagan commented Mar 9, 2021

Saw one of these in a firebase async onRequest call (Node 10 runtime) on 02/15/2021

Here's the stack ...

Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)
    at Object.callErrorFromStatus (/workspace/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:176:52)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:342:141)
    at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:305:181)
    at process.nextTick (/workspace/node_modules/@grpc/grpc-js/build/src/call-stream.js:124:78)
    at process._tickCallback (internal/process/next_tick.js:61:11)

@dronpopdev
Copy link

I got this on onCreate triggers. Cloud Firestore + Cloud Functions.

Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: read ECONNRESET
at Object.callErrorFromStatus (/workspace/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:176:52)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
at /workspace/node_modules/@grpc/grpc-js/build/src/call-stream.js:145:78
at processTicksAndRejections (internal/process/task_queues.js:79:11)

More details. I have created 15 objects. Each object was created approximately once every 20 seconds. It happened on March 12th.

@bcoe
Copy link
Contributor

bcoe commented Mar 12, 2021

@dronpopdev could you ensure the latest version of @grpc/grpc-js is in your package-lock.json (https://www.npmjs.com/package/@grpc/grpc-js) redeploy your application, and share the latest version of the error message -- if you're still running into issues.

We've been working to add improved error messages to the library.

@LKNSI
Copy link

LKNSI commented Mar 30, 2021

Seeing these on non-google connections with gRPC. But while using a google library that has it's own gRPC connection within the context of the call made on our applications. Near identical message even when not using a google library.

Bidirectional Streaming:

i.e. Microservice -> (grpc connection) -> Server -> (Google Library that has a streaming gRPC connection (in our case speech to text) -> Response to microservice

"@grpc/grpc-js": "1.2.12"

Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)
at Object.callErrorFromStatus (/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
at Object.onReceiveStatus (/node_modules/@grpc/grpc-js/build/src/client.js:387:49)
at Object.onReceiveStatus (/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
at /node_modules/@grpc/grpc-js/build/src/call-stream.js:145:78
at processTicksAndRejections (internal/process/task_queues.js:79:11)

Okay so this will definitely apply to a lot of people - I found out that it was actually HAProxy timing out the connection, when using something gRPC related, either from google or locally produced - even if live messages are being clearly sent with GRPC_TRACE=all , and are being received properly. I guess in some cases this might either be a frontend issue or something else.

@vishalvijay
Copy link

Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: read ECONNRESET
at Object.callErrorFromStatus (/workspace/node_modules/@grpc/grpc-js/build/src/call.js:31)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:176)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299)
at (/workspace/node_modules/@grpc/grpc-js/build/src/call-stream.js:145)
at processTicksAndRejections (internal/process/task_queues.js:79)

Facing same issue with Firebase pubsub schedule function

functions
  .region('asia-south1')
  .pubsub.schedule('every 1 minutes')
  .onRun(async () => {
    await theWork();
  });

@tfalvo
Copy link

tfalvo commented May 17, 2021

Facing exactly the same issue with Cloud Tasks:

Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: read ECONNRESET
    at Object.callErrorFromStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client.js:176:52)
    at Object.onReceiveStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
    at Object.onReceiveStatus (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
    at /usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:145:78
    at processTicksAndRejections (internal/process/task_queues.js:79:11) 

This happens quite rarely, but when happening, it's not in a context of massive task creation, just a single task created :

await this.client.createTask({
      parent: queueName,
      task: {...}
});

@dhruv-sehgal
Copy link

dhruv-sehgal commented May 21, 2021

@tfalvo , were you able to solve above problem. Facing similar problem with cloud task.

@Chm-vinicius
Copy link

Same issue here, when try to migrate db from realtimedatabe to firestore, on localhost with small sample of db the migration function works very well, but when i use entire legacy db i got this errors and emulators got shutdown:

Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) at Object.callErrorFromStatus (workspace\functions\node_modules\@grpc\grpc-js\build\src\call.js:31:26) at Object.onReceiveStatus (workspace\functions\node_modules\@grpc\grpc-js\build\src\client.js:176:52) at Object.onReceiveStatus (workspace\functions\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:336:141) at Object.onReceiveStatus (workspace\functions\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:299:181) at workspace\functions\node_modules\@grpc\grpc-js\build\src\call-stream.js:145:78 at processTicksAndRejections (internal/process/task_queues.js:75:11) Caused by: Error at WriteBatch.commit (workspace\functions\node_modules\@google-cloud\firestore\build\src\write-batch.js:413:23) at DocumentReference.set (workspace\functions\node_modules\@google-cloud\firestore\build\src\reference.js:350:14) at userIterator (workspace\functions\dbMigrator.js:270:28) at workspace\functions\dbMigrator.js:276:5 at local\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:604:16 at runFunction (local\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:583:15) at runHTTPS (local\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:603:11) at handler (local\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:532:23) at Layer.handle [as handle_request] (local\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\express\lib\router\layer.js:95:5) at next (local\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\express\lib\router\route.js:137:13)

@odira1
Copy link

odira1 commented Jun 20, 2021

Had this error happen after a couple of deletes on datastore, resolved it by ensuring that the process exited properly with process.exit(0). hope this helps someone, cheers :)

@crwilcox
Copy link
Contributor

In order for us to gather feedback better, please add any further details to the Firestore issue at googleapis/nodejs-firestore#1023. The root cause is likely the same and it seems better to gather feedback in a single place. Feel free to add there if you see an issue.

@crwilcox crwilcox added external This issue is blocked on a bug with the actual product. and removed 🚨 This issue needs some love. labels Jul 22, 2021
@googleapis googleapis locked as resolved and limited conversation to collaborators Jul 22, 2021
@meredithslota
Copy link
Contributor

Closing this out as discussion and investigation have continued in the issue linked above, and we are optimistic that a fix has been found and implemented, see here: googleapis/nodejs-firestore#1023 (comment) If this issue is not fixed for you, please add your repro steps to that issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. external This issue is blocked on a bug with the actual product. priority: p2 Moderately-important priority. Fix may not be included in next release. 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