Coding Bits
June 7th, 2024

AWS Secrets Manager Cached Credentials Error

AWS

Spent around two hours trying to diagnose why one of our containers couldn't read secrets from AWS Secrets Manager. I was seeing errors of the following form when I was trying to call GetSecretValue:

operation error Secrets Manager: GetSecretValue, 
get identity: get credentials: 
failed to refresh cached credentials, not found, Signing

Turned out to be a bug in version v1.29.2 of the secrets manager client: github.com/aws/aws-sdk-go-v2/service/secretsmanager. Downgrading the client version to v1.25.4 seems to have resolved the problem.

Could also be a version miss-match with github.com/aws/aws-sdk-go-v2 v1.27.1. Might be if I were to change the version of the AWS SDK Go client, it would work as well. However, this error was showing up with the latest released versions of both dependencies, so my bet is a bug somewhere.

Anyway, for anyone else experiencing this problem, this is what worked for me.