MeWrite Docs

IncompleteSignature: The request signature we calculated does not match

概要

AWSのAPIリクエストの署名が不完全または正しく計算されていない場合に発生するエラーです。シークレットアクセスキーの誤り、タイムスタンプのずれ、リージョン指定の不一致などが原因です。

エラーメッセージ

IncompleteSignature: The request signature we calculated does not match the signature you provided.
An error occurred (IncompleteSignature) when calling the ListBuckets operation: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method.

原因

このエラーは以下の原因で発生します:

  1. シークレットアクセスキーの誤り: キーのコピーミスや一部欠落
  2. システム時刻のずれ: サーバーの時刻がずれている
  3. リージョンの不一致: 署名時のリージョンとリクエスト先が異なる
  4. 特殊文字のエスケープ問題: シークレットキーの特殊文字が正しく処理されていない
  5. 署名バージョンの問題: Signature Version 2/4 の不一致

解決策

1. シークレットアクセスキーを確認

1
2
3
4
5
# 認証情報を再設定
aws configure

# シークレットキーを慎重に入力
# コピペ時に余分な空白がないか確認

2. システム時刻を同期

1
2
3
4
5
6
7
8
9
# Linux: NTPで時刻同期
sudo timedatectl set-ntp true
timedatectl status

# macOS
sudo sntp -sS time.apple.com

# 時刻のずれを確認
date

3. リージョンを正しく指定

1
2
3
4
5
6
7
8
# リージョンを明示的に指定
aws s3 ls --region ap-northeast-1

# 設定を確認
aws configure get region

# リージョンを設定
aws configure set region ap-northeast-1

4. 環境変数を確認

1
2
3
4
5
6
7
8
9
# 環境変数でリージョンを設定
export AWS_DEFAULT_REGION=ap-northeast-1

# 不要な環境変数をクリア
unset AWS_SECRET_ACCESS_KEY
unset AWS_ACCESS_KEY_ID

# 再設定
aws configure

5. SDK での対処

1
2
3
4
5
6
7
8
# Python (boto3)
import boto3

# リージョンを明示的に指定
client = boto3.client(
    's3',
    region_name='ap-northeast-1'
)
1
2
3
4
5
6
// Node.js
import { S3Client } from "@aws-sdk/client-s3";

const client = new S3Client({
    region: "ap-northeast-1"
});

よくある間違い

  • シークレットキーの最後の文字が欠けている
  • コンテナやサーバーレス環境で時刻が同期されていない
  • S3のグローバルエンドポイントを使用してリージョン固有のバケットにアクセス
  • プロキシ経由でリクエストが改変されている

デバッグ方法

1
2
# デバッグ出力で署名プロセスを確認
aws s3 ls --debug 2>&1 | grep -i signature

関連エラー

参考リンク

関連エラー

AWS の他のエラー

最終更新: 2025-12-16