SignatureDoesNotMatch is the S3 API saying it computed the request’s signature itself and got a different answer from the one you sent. With an S3-compatible service it is often the first error you see, and it rarely means the service is broken. Something in the request, or the secret it was signed with, is not what the server sees.
What gets signed
With Signature Version 4, the client hashes a canonical form of the request (the method, the path, the query string, the Host header, the x-amz-date and x-amz-content-sha256 headers, and any other headers it chose to sign), then signs that with a key derived from your secret, the date, the region and the service name. The server repeats the work with its copy of the secret. Any difference anywhere in that list gives a different signature.
So the checklist is the list of things that can differ.
1. The secret
The most common cause by far. A secret copied with a trailing space or newline, the secret of a different key pair, or a key id from one place and a secret from another. If the access key id itself is unknown, a well-behaved endpoint says InvalidAccessKeyId instead; SignatureDoesNotMatch means the id was found and the secret did not fit.
Watch for credentials the client picks up on its own: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in the environment come before the shared credentials file in most SDKs’ default chain, so a shell that still holds your AWS keys signs with them.
2. The region
The region is part of the signing key. Sign for us-east-1 against a service that expects another region and the signature cannot match. Some services name the expected region in a more specific error, others answer SignatureDoesNotMatch. Set the region the provider gives you, even if the SDK says it is optional.
3. The host and the path
The Host header and the path are signed. A proxy that rewrites either, or a client that moved the bucket into the hostname (virtual-hosted style) when the service expects it in the path, signs something the server never receives. Turn on path-style addressing for services that use it; every SDK has a switch for it.
Keys with spaces, + or non-ASCII characters are a classic case for hand-written clients: S3 encodes the path once, and a client that encodes it twice, or not at all, signs a different path.
4. The body
A SigV4 request also carries a hash of its body in x-amz-content-sha256. If anything changes the body after signing (a retry that re-reads a stream from the wrong position, middleware that compresses it), the hash no longer fits. Some services report that as its own error rather than as a signature mismatch.
5. The clock and the expiry
The signature includes the time. A machine whose clock is more than 15 minutes off is refused, usually with RequestTimeTooSkewed; fix its time sync. A presigned URL has an expiry written into it, and changing anything in the URL after it was made (re-encoding the query, adding a parameter) breaks it.
See what the client signed
Both common clients will show you the canonical request and the string they signed:
aws s3 ls s3://acme-backups --endpoint-url https://objects.subnomic.com --debug 2>&1 | grep -A20 CanonicalRequest
import logging, boto3 boto3.set_stream_logger("botocore", logging.DEBUG)
Compare the host, the path and the signed headers in that output with what you meant to send. The difference is the bug.
On Subnomic Storage
The endpoint answers with the most specific code it can, so the error points at one item on the list above:
| Error | Look at |
|---|---|
SignatureDoesNotMatch | The secret, and anything that rewrites the host, the path or the body |
InvalidAccessKeyId | The key id; often AWS credentials picked up from the environment |
AuthorizationHeaderMalformed, expecting eu-west-1 | The region |
XAmzContentSHA256Mismatch | The body changed after it was hashed |
RequestTimeTooSkewed | The machine’s clock |
ExpiredToken | A presigned URL past its expiry, at most seven days |
Could not resolve <bucket>.objects.subnomic.com | Path-style addressing is off |
The endpoint is https://objects.subnomic.com, the region eu-west-1, and addressing is path-style. Working setups for the AWS CLI, boto3, Go, Node.js, Rust and rclone, and the full error table, are in S3 clients. Why the region is part of the signature at all is in The region is part of the signature.