nodejs-vision
nodejs-vision copied to clipboard
Error: 13 INTERNAL: Received RST_STREAM with code 2
Yo, I've been having this random error lately, and I have no idea why.
Error: 13 INTERNAL: Received RST_STREAM with code 2
details: 'Received RST_STREAM with code 2', metadata: Metadata { internalRepr: Map {}, options: {} }, note: 'Exception occurred in retry method that was not classified as transient
Code:
const vision = require('@google-cloud/vision');
const client = new vision.ImageAnnotatorClient({projectId: "...", keyFilename: "....json"});
...
const [result] = await gclient.textDetection(image);
const texts = result.fullTextAnnotation;
console.log(texts)
The image is a remote url.
And thanks in advance.
Could you share your environment details?
- OS:
- Node.js version:
- npm version:
-
@google-cloud/vision
version:
How frequently is this happening? Thanks!
Yes
- OS: Windows 10
- Node.js version: 12.16.3
- npm version: 6.14.5
- @google-cloud/vision version: ^1.11.0
It's happening alot.
I am having same issue as well
Making sure @alexander-fenster and @murgatroid99 see this
I am having same issue as well. It happened on Sep 10, 2020.
OS: CentOS Linux release 7.7.1908 Node.js version: 12.16.1 @google-cloud/vision version: 2.1.1
"Error: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error at Object.callErrorFromStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call.js:31:26 at Object.onReceiveStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/client.js:176:52 at Object.onReceiveStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:342:141 at Object.onReceiveStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:305:181 at Http2CallStream.outputStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call-stream.js:117:74 at Http2CallStream.maybeOutputStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call-stream.js:156:22 at Http2CallStream.endCall (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call-stream.js:142:18 at ClientHttp2Stream.
(/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call-stream.js:420:22 at ClientHttp2Stream.emit (events.js:311:20 at emitCloseNT (internal/streams/destroy.js:69:8 at emitErrorAndCloseNT (internal/streams/destroy.js:61:3 at processTicksAndRejections .processTicksAndRejections (internal/process/task_queues.js:84:21 undefined)"
We got this error, but also this one around the same time, for another request:
"Error: 8 RESOURCE_EXHAUSTED: Bandwidth exhausted at Object.callErrorFromStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call.js:31:26 at Object.onReceiveStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/client.js:176:52 at Object.onReceiveStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:342:141 at Object.onReceiveStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:305:181 at Http2CallStream.outputStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call-stream.js:117:74 at Http2CallStream.maybeOutputStatus (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call-stream.js:156:22 at Http2CallStream.endCall (/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call-stream.js:142:18 at ClientHttp2Stream.
(/usr/src/app/webint-enrichment-service/node_modules/@google-cloud/vision/node_modules/@grpc/grpc-js/build/src/call-stream.js:420:22 at ClientHttp2Stream.emit (events.js:311:20 at emitCloseNT (internal/streams/destroy.js:69:8 at emitErrorAndCloseNT (internal/streams/destroy.js:61:3 at processTicksAndRejections .processTicksAndRejections (internal/process/task_queues.js:84:21 undefined)"
I've been seeing this issue today. Running latest @google-cloud/vision-2.3.0
with node 15.3.0
Same thing as others, Error: 13 INTERNAL: Received RST_STREAM with code 2
and every so often 8 RESOURCE_EXHAUSTED: Bandwidth exhausted
despite not having exceeded any quota on console.
Only calls to Google are:
const client = new vision.ImageAnnotatorClient({keyFilename : "..."});
client.batchAnnotateImages({requests : [{image : {content : pngData}, features : [{type : "LABEL_DETECTION"}, {type : "DOCUMENT_TEXT_DETECTION"}, {type : "SAFE_SEARCH_DETECTION"}]}]})
pngData is the raw PNG data from disk. Same identical code was working fine several days ago, just started getting this error for the first time today, no code changes.
I worked around this bug by ditching the @google-cloud/vision
library and calling the HTTP API endpoint directly.
See here: https://cloud.google.com/vision/docs/quickstart-cli
To get a Bearer auth_token
in nodejs, npm install googleapis
and then:
this.data.jwt = new google.auth.JWT(client_email, null, private_key, ["https://www.googleapis.com/auth/cloud-vision"], null);
this.data.jwt.authorize(this);
client_email
and private_key
can be found in your service_account key file.
The response includes a access_token
which should be sent as an HTTP header Authorization: Bearer ${access_token}
in your HTTP POST to https://vision.googleapis.com/v1/images:annotate
Note: You'll get a 404 error on the URL if you don't have the Authorization header. Once you add the header it works fine.
Using this direct approach everything works great, no errors or problems.
This issue is clearly a client side bug in a core component of Google's RPC node client libraries. This issue has been filed with multiple, other, google, api, libraries and goes back over 1 year. Since this doesn't appear to be a priority fix, I recommend everyone start calling the HTTP API endpoints directly.
Hi folks,
If you keep seeing 13 INTERNAL
errors mentioning RST_STREAM
with code 2, please make sure you updated your dependency tree: rm -rf node_modules package-lock.json && npm install
. Please make sure you have @grpc/grpc-js
v1.2.9 or higher:
npm ls @grpc/grpc-js
If you keep seeing the issue on the newer gRPC version, please do report here.
Thank you!
@alexander-fenster Still getting these errors mate.
"@google-cloud/vision": "^2.3.1",
"@grpc/grpc-js": "1.2.10"
Node: v12.16.1
MacOS: 10.15.7
This issue is still occurring when processing large volumes of images. We're getting the original error it's only started happening today prior to the upgrade we were running vision ^1.9.0
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:176:52)
at Object.onReceiveStatus (node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
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)
as well as
Error: 8 RESOURCE_EXHAUSTED: Bandwidth exhausted
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:176:52)
at Object.onReceiveStatus (node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
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)
Bump because I'm also having this issue. Similar to @david-taggun I'm getting this error when sending larger quantities of images (not that crazy or anything)
Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: read ECONNRESET
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:176:52)
at Object.onReceiveStatus (node_modules\@grpc\grpc-js\build\src\client-interceptors.js:336:141)
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:75:11)
Seems to be happening whenever I send around 30+ images within a couple minutes. Whenever I'm not getting the error it is taking painfully long to get a response (like 2-3 minutes for 8-10 images). Also, the images aren't crazy intricate or anything. They're fairly basic images such as a simple picture of a bus with nothing else.
"@google-cloud/vision": "^2.3.1"
"@grpc/grpc-js": "^1.2.12"
Node: `v14.15.5`
Windows: 10.0.19042 Build 19042
I'm also receiving the same issue when requesting from the db, and while my db is pretty large, I'm setting the request with a limit() of 3.
Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: Protocol error .Object.callErrorFromStatus ( /workspace/node_modules/@grpc/grpc-js/build/src/call.js:31 )
grpc: "version": "1.2.11",
I'm also receiving the same issue when requesting from the db, and while my db is pretty large, I'm setting the request with a limit() of 3.
`Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: Protocol error
.Object.callErrorFromStatus ( /workspace/node_modules/@grpc/grpc-js/build/src/call.js:31 )`
grpc: "version": "1.2.11",
Just to test my code, when I run the same request in the emulator with a significantly smaller db. I have no errors. So I think that the error comes from looking for all the files even though I'm limiting it to three
A handful of related issues have been closed (in the gRPC layer) which we believe resolves the issue. Is anyone in this thread still seeing the issue with a recent version of the library? I'm going to close this out shortly if not.
If you are still seeing the issue, please include which version of the library / gRPC you're using. Thanks!