Windows10 AWS-CLIで「InvalidSignatureException」エラー
何も悪いことしてないのに、AWS-CLIで InvalidSignatureException
が出た。
Windows10だと、シークレットアクセスキーに /
か +
が入ってるとダメらしい。
Windows10でAWS-CLIを入れて aws lambda list-functions
を実行したら、次のエラーが出た。
An error occurred (InvalidSignatureException) when calling the ListFunctions operation: 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.
ぐぐったら以下の記事が見つかった。
シークレットアクセスキーに /
が入ってるとダメらしい。自分は /
が含まれたキーを使っていたので、それで引っかかったんだと思う。結局、アクセスキーを再生成しなければならなかった。
記事内の元ネタのIssueは以下。
SignatureDoesNotMatch error · Issue #602 · aws/aws-cli · GitHub
もう少し詳しく見ると、たぶんWindows10でシークレットアクセスキーに /
か +
が入ってるとダメな模様。
当該コメントは以下。
Just hit this in 2020 now. Secret key has a '+'.
aws-cli — developed by aws project — fails with valid aws keys... for 6 years?
Same problem in 2020 January. Secret key has a "/" slash character.
I generated a new credential set, using the AWS IAM console, and ensured that the secret key was all alphanumeric, no "/" no "+" and so on. I replaced my old secret key with the new secret key, in my ~/.aws/credentials file, then retried.
This solved it.
Ubuntu on Windowsでやってる人も同じエラーが出たようなので、Windows10だと、アクセスキーを再発行する以外にどうしようも無さそう。
最新のコメントは2020年3月16日。まだ直ってないらしい。