Filipe Aleixo
Filipe Aleixo

Reputation: 4242

Google Speech Adaptation Client (node.js) - UnhandledPromiseRejectionWarning: Error: 13 INTERNAL: Internal error encountered

I'm trying to create a CustomClass using the nodejs AdaptationClient from the Google Speech API (documentation here https://googleapis.dev/nodejs/speech/latest/v1p1beta1.AdaptationClient.html)

I'm running on Elastic Beanstalk with the following config: Node.js 12 running on 64bit Amazon Linux 2/5.3.1

const speechToText = require('@google-cloud/speech').v1p1beta1;

const adaptationClient = new speechToText.AdaptationClient({
    credentials: {client_email: client_email,
                  private_key: private_key},
    projectId: project_id
});

const request = {
    parent: 'v1p1beta1/projects/myproject/locations/global/customClasses',
    customClassId: 'test-class',
    customClass: {"items": [{value: "foo"}, {value: "bar"}]}
}

const [response] = await adaptationClient.createCustomClass(request)

Result:

web: (node:31369) UnhandledPromiseRejectionWarning: Error: 13 INTERNAL: Internal error encountered.
web: at Object.callErrorFromStatus (/var/app/current/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
web: at Object.onReceiveStatus (/var/app/current/node_modules/@grpc/grpc-js/build/src/client.js:176:52)
web: at Object.onReceiveStatus (/var/app/current/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
web: at Object.onReceiveStatus (/var/app/current/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
web: at /var/app/current/node_modules/@grpc/grpc-js/build/src/call-stream.js:145:78
web: at processTicksAndRejections (internal/process/task_queues.js:79:11)

I'm sure the service account I'm using is valid, since all the calls I do using SpeechClient() run without problems.

Upvotes: 2

Views: 444

Answers (1)

Arokya Nehrayous
Arokya Nehrayous

Reputation: 71

We have found a GitHub code sample for model adaptation in nodejs which I tested and it runs fine without any error

I would like to recommend you to try to run by changing the parent source to 'projects/myproject/locations/global' instead of 'v1p1beta1/projects/myproject/locations/global/customClasses'. Here 'myproject' should be the projectID

Upvotes: 1

Related Questions