I'm running speech-to-text stream on a express.js server to get real time transcription for phone calls. I have tried both speech-to-text V1 and V2. The V1 works smoothly. However the V2 streams throw the following exception when there are any stream running at the same time. Is there any restriction on V2?
Thanks.
1 CANCELLED: The operation was cancelled.
2023-10-02T11:42:33.203542+00:00 app[web.1]: at callErrorFromStatus (/app/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
2023-10-02T11:42:33.203543+00:00 app[web.1]: at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client.js:419:73)
2023-10-02T11:42:33.203543+00:00 app[web.1]: at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
2023-10-02T11:42:33.203544+00:00 app[web.1]: at /app/node_modules/@grpc/grpc-js/build/src/resolving-call.js:99:78
2023-10-02T11:42:33.203544+00:00 app[web.1]: at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
2023-10-02T11:42:33.203545+00:00 app[web.1]: for call at
2023-10-02T11:42:33.203545+00:00 app[web.1]: at ServiceClientImpl.makeBidiStreamRequest (/app/node_modules/@grpc/grpc-js/build/src/client.js:403:32)
2023-10-02T11:42:33.203546+00:00 app[web.1]: at ServiceClientImpl.<anonymous> (/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
2023-10-02T11:42:33.203546+00:00 app[web.1]: at /app/node_modules/@google-cloud/speech/build/src/v2/speech_client.js:317:29
2023-10-02T11:42:33.203546+00:00 app[web.1]: at /app/node_modules/google-gax/build/src/streamingCalls/streamingApiCaller.js:46:28
2023-10-02T11:42:33.203547+00:00 app[web.1]: at /app/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
2023-10-02T11:42:33.203547+00:00 app[web.1]: at StreamProxy.setStream (/app/node_modules/google-gax/build/src/streamingCalls/streaming.js:144:24)
2023-10-02T11:42:33.203547+00:00 app[web.1]: at StreamingApiCaller.call (/app/node_modules/google-gax/build/src/streamingCalls/streamingApiCaller.js:54:16)
2023-10-02T11:42:33.203548+00:00 app[web.1]: at /app/node_modules/google-gax/build/src/createApiCall.js:84:30
2023-10-02T11:42:33.203548+00:00 app[web.1]: at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
2023-10-02T11:42:33.203548+00:00 app[web.1]: code: 1,
2023-10-02T11:42:33.203549+00:00 app[web.1]: details: 'The operation was cancelled.',
2023-10-02T11:42:33.203549+00:00 app[web.1]: metadata: Metadata { internalRepr: Map(0) {}, options: {} }
2023-10-02T11:42:33.203549+00:00 app[web.1]: }
The error message you provided, "CANCELLED: The operation was cancelled," is a common error message in gRPC-based applications. It indicates that a gRPC operation was canceled for some reason. Common reasons for a gRPC operation to be canceled include:
1. The operation took too long to complete, and a timeout occurred.
2. The client explicitly canceled the operation.
3. The server canceled the operation for some reason, such as an internal error or a rate limiting policy.
To troubleshoot the issue, consider checking the following:
1. Review your code to ensure that there are no explicit cancellations being made from the client side.
2. Check if you have set appropriate timeouts for your gRPC calls to prevent them from running indefinitely.
3. Investigate any potential issues with your network connectivity or server-side policies that might lead to cancellations.
Ensure that you are using the latest versions of the gRPC client library and the Google Cloud Speech-to-Text library to benefit from bug fixes and updates.