aws-sdk-js-v3
aws-sdk-js-v3 copied to clipboard
InvalidSignatureException: Signature expired
Checkboxes for prior research
- [X] I've gone through Developer Guide and API reference
- [X] I've checked AWS Forums and StackOverflow.
- [X] I've searched for previous similar issues and didn't find any solution.
Describe the bug
This issue is just re-opening https://github.com/aws/aws-sdk-js-v3/issues/5192 which was never solved. If you initialize a secrets-manager client in a lambda runtime which gets frozen and then later (after 5 minutes) the lambda is triggered and tries to fetch a secret you will hit the signature expired error. The suggested workarounds in #5192 (such as using top-level await) are untenable as they would require extensive code rework. It would be great to identify why exactly expired signatures are being sent. @trivikr explained the process for making signed requests in https://github.com/aws/aws-sdk-js-v3/issues/5192#issuecomment-1836916445 although it does appear as if the constructor is somehow setting a signature which later expires, as described by @deanc in https://github.com/aws/aws-sdk-js-v3/issues/5192#issuecomment-1986264214
SDK version number
"@aws-sdk/client-secrets-manager": "^3.549.0"
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Node.js 20.x
Reproduction Steps
export const secretsManager = AWSXRay.captureAWSv3Client(
new SecretsManagerClient(commonConfiguration),
);
import secretsManager
into a lambda runtime, but don't request any secrets. Wait 5 minutes. Invoke the lambda and request a secret.
Observed Behavior
Invalid signature error
Expected Behavior
Properly set signature.
Possible Solution
No response
Additional Information/Context
No response