-
Notifications
You must be signed in to change notification settings - Fork 636
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
We are using the Transcribe streaming client in a NodeJs application to stream received audio data to AWS Transcribe (using StartStreamTranscriptionCommandInput) and process transcription results.
This application is running via Docker container running on an EC2 instance (ARM/Graviton) configured with an instance profile with the relevant IAM permissions to Transcribe, and uses IMDSv2
The Client is created as follows:
const transcribeClient = new TranscribeStreamingClient({ region: AWS_REGION, endpoint: transcribeEndpoint, });
Where we are using the eu-west-1 region and the endpoint is a PrivateLink endpoint in our VPC.
The audio streams we are processing last anywhere from seconds to an hour.
This is generally working fine most of the time, however we see intermittent exceptions from the client as follows (removed parts of it for security):
BadRequestException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'...'
The String-to-Sign should have been
'AWS4-HMAC-SHA256-PAYLOAD
20251020T132607Z
20251020/eu-west-1/transcribe/aws4_request
...'
at de_BadRequestExceptionRes (/app/node_modules/@aws-sdk/client-transcribe-streaming/dist-cjs/index.js:883:23)
at de_BadRequestException_event (/app/node_modules/@aws-sdk/client-transcribe-streaming/dist-cjs/index.js:1178:12)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /app/node_modules/@aws-sdk/client-transcribe-streaming/dist-cjs/index.js:1147:38
at async Object.deserializer (/app/node_modules/@smithy/eventstream-serde-universal/dist-cjs/index.js:83:43)
at async SmithyMessageDecoderStream.asyncIterator (/app/node_modules/@smithy/eventstream-codec/dist-cjs/index.js:358:34)
at async nextAsync (node:internal/streams/from:182:33)
There doesn't appear to be any particular pattern as to when these exceptions occur.
As the AWS SDK handles retrieving/refreshing credentials, is this a bug in the client not refreshing in a timely manner, or some other such issue?
I am struggling to see what (if anything) I can do from my side to affect the signature generation and hence stop these errors.
Any help would be much appreciated.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.19.4
Reproduction Steps
Cannot reliably reproduce
Observed Behavior
Exception as stated raised
Expected Behavior
No exceptions raised
Possible Solution
No response
Additional Information/Context
No response