googleapis / googleapis/google-cloud-node
Chat bison 2 predictions throw error "13 INTERNAL: Received RST_STREAM with code 0" in cloud instance, but work properly in local setup
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 712
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 99
Description
- which product (packages/*): "@google-cloud/aiplatform": "^3.8.0",
- OS: Ubuntu 22.06
- Node.js version: 18.19.0
- npm version: 10.2.3
- google-cloud-node version:
code which is causing the issue
const instanceValue = helpers.toValue(prompt);
const instances = [instanceValue];
const parameter = {
temperature: 0.2,
maxOutputTokens: 256,
topP: 0.95,
topK: 40,
};
const parameters = helpers.toValue(parameter);
const request = {
endpoint,
instances,
parameters,
};
// Predict request
const [response] = await predictionServiceClient.predict(
request as protos.google.cloud.aiplatform.v1.IPredictRequest
);
const predictions = response.predictions;
if (!predictions) {
throw new Error('Predictions are empty');
}
logger.info(predictions);
for (const prediction of predictions) {
const predic =
prediction?.structValue?.fields?.candidates?.listValue?.values?.[0]
?.structValue?.fields?.content?.stringValue;
return predic as string;
}
I tried using Application Default Credentials as mentioned in an other issue [here](https://github.com/googleapis/nodejs-ai-platform/issues/272) but the issue still persist.
I want to mention that this issue occur only in cloud instance (I have deployed my node application in oracle cloud ARM Ampere A1 compute instance), it is working perfectly fine in my local setup.
The error which im facing:
Error: 13 INTERNAL: Received RST_STREAM with code 0
at callErrorFromStatus (/home/ubuntu/Projects/sample-project/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
at Object.onReceiveStatus (/home/ubuntu/Projects/sample-project/node_modules/@grpc/grpc-js/build/src/client.js:192:76)
at Object.onReceiveStatus (/home/ubuntu/Projects/sample-project/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
at Object.onReceiveStatus (/home/ubuntu/Projects/sample-project/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
at /home/ubuntu/Projects/sample-project/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 (/home/ubuntu/Projects/sample-project/node_modules/@grpc/grpc-js/build/src/client.js:160:32)
at ServiceClientImpl. (/home/ubuntu/Projects/sample-project/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
at /home/ubuntu/Projects/sample-project/node_modules/@google-cloud/aiplatform/build/src/v1/prediction_service_client.js:249:29
at /home/ubuntu/Projects/sample-project/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
at OngoingCallPromise.call (/home/ubuntu/Projects/sample-project/node_modules/google-gax/build/src/call.js:67:27)
at NormalApiCaller.call (/home/ubuntu/Projects/sample-project/node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19)
at /home/ubuntu/Projects/sample-project/node_modules/google-gax/build/src/createApiCall.js:84:30
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 13,
details: 'Received RST_STREAM with code 0',
metadata: Metadata { internalRepr: Map(0) {}, options: {} },
}
When I'm testing the same application in an n2d-standard-2 instance in google cloud, the issue is not occurring. Could anyone please guide me why this might be happening?
Contributor guide
Assessment
This issue has not been assessed yet.