You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Middy Secret manager middleware fails with InvalidSignatureException error. Signature expired: 20250116T095814Z is now earlier than 20250116T095815Z (20250116T100315Z - 5 min.
Error happens in complete random scenarios
It happens on both cold start and warm functions
Executing the same lambda function again sometimes throw the same error but sometimes works fine.
Function doesn't manipulate the clock.
To Reproduce
How to reproduce the behaviour:
Lambda function used for a REST API
import secretsManager from '@middy/secrets-manager'
ErrorError: Failed to resolve internal values\n at getInternal (file:///var/task/node_modules/@middy/util/index.js:83:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async secretsManagerMiddlewareBefore (file:///var/task/node_modules/@middy/secrets-manager/index.js:103:20)\n at async runMiddlewares (file:///var/task/node_modules/@middy/core/index.js:230:17)\n at async runRequest (file:///var/task/node_modules/@middy/core/index.js:154:5)
Error cause { "output": "<_HttpResponse>", "parsedBody": { "__type": "InvalidSignatureException", "message": "Signature expired: 20250116T095814Z is now earlier than 20250116T095815Z (20250116T100315Z - 5 min.)" }, "errorCode": "InvalidSignatureException" }
Expected behaviour
Fetch secrets from the secret manager without a failure
Environment :
Node.js: 20
Middy: 5.5.1
"@middy/secrets-manager": "5.5.1"
AWS SDK: "3.709.0"
@aws-sdk/client-secrets-manager": "3.709.0"
The text was updated successfully, but these errors were encountered:
This has been reported in the past. Thought at the time is that it's an aws issue because we don't mess with signatures to AWS services. The secrets-manager middleware is just a wrapper around GetSecretValueCommand. Perhaps opening a ticket for the AWS SDK is in order.
We added in a function, catchInvalidSignatureException, to catch this type of error and do one retry and that seems to solve it for most people. Not sure what else middy can do to address this.
Describe the bug
Middy Secret manager middleware fails with InvalidSignatureException error.
Signature expired: 20250116T095814Z is now earlier than 20250116T095815Z (20250116T100315Z - 5 min.
To Reproduce
How to reproduce the behaviour:
import secretsManager from '@middy/secrets-manager'
secretsManager({ fetchData: {keys_here}, setToContext: true, })
Error: Failed to resolve internal values\n at getInternal (file:///var/task/node_modules/@middy/util/index.js:83:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async secretsManagerMiddlewareBefore (file:///var/task/node_modules/@middy/secrets-manager/index.js:103:20)\n at async runMiddlewares (file:///var/task/node_modules/@middy/core/index.js:230:17)\n at async runRequest (file:///var/task/node_modules/@middy/core/index.js:154:5)
{ "output": "<_HttpResponse>", "parsedBody": { "__type": "InvalidSignatureException", "message": "Signature expired: 20250116T095814Z is now earlier than 20250116T095815Z (20250116T100315Z - 5 min.)" }, "errorCode": "InvalidSignatureException" }
Expected behaviour
Fetch secrets from the secret manager without a failure
Environment :
The text was updated successfully, but these errors were encountered: