SignatureDoesNotMatch: The request signature we calculated does not match
概要
AWSのAPIリクエストで計算された署名がサーバー側の期待値と一致しない場合に発生するエラーです。シークレットキーの誤り、時刻のずれ、またはリクエストの改変が原因です。
エラーメッセージ
SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
An error occurred (SignatureDoesNotMatch) when calling the PutObject operation: The request signature we calculated does not match the signature you provided.
原因
このエラーは以下の原因で発生します:
- シークレットアクセスキーの誤り: キーが間違っているか欠損
- システム時刻のずれ: 15分以上のずれで署名が無効に
- リクエストの改変: プロキシやミドルウェアがリクエストを変更
- エンコーディングの問題: URLエンコードの不一致
- ヘッダーの不一致: 署名対象のヘッダーが変更された
解決策
1. シークレットキーを再確認
| |
2. システム時刻を確認・同期
| |
3. プロキシ設定を確認
| |
4. S3 のパス形式を確認
| |
5. SDKのバージョンを更新
| |
| |
特殊文字を含むキーの対処
| |
Docker環境での対処
| |
| |
よくある間違い
- EC2/ECS のメタデータサービスへのアクセスがブロックされている
- Lambda関数のタイムアウトで時刻ずれが蓄積
- VPCエンドポイント経由でリクエストが改変される
- マルチパートアップロードで署名が不一致
デバッグ
| |
関連エラー
参考リンク
関連エラー
AWS の他のエラー
AccessDeniedException: User is not authorized
ECS CannotPullContainerError
AccessDenied: User is not authorized to perform sts:AssumeRole
IncompleteSignature: The request signature we calculated does not match
MissingAuthenticationToken: Missing Authentication Token
UnrecognizedClientException: The security token included in the request is invalid
この記事は役に立ちましたか?