Question

s3cmd SignatureDoesNotMatch

Problem

When I try to use s3cmd it exits with the following error:

ERROR: S3 error: 403 (SignatureDoesNotMatch)

Attempted Solutions

I have tried regenerating my keys as other similar questions suggested.

Context

I am using s3cmd version 2.0.2.

My s3cmd configuration has the following relevant options:

[default]
access_key = REDACTED
access_token = REDACTED
...
host_base = sfo2.digitaloceanspaces.com
host_bucket = %(bucket)s.sfo2.digitaloceanspaces.com

The s3cmd command I am trying to run is:

s3cmd put foo.txt s3://SPACE/ -c ./s3cmd-cfg

The space I am trying to access is in SFO2.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

jarland
DigitalOcean Employee
DigitalOcean Employee badge
February 20, 2019
Accepted Answer

Hey friend,

I do not consider myself an expert on s3cmd, and I realize that you already have a configuration file, but can you try setting up the configuration specifically by the steps we’ve outlined here?

https://www.digitalocean.com/docs/spaces/resources/s3cmd/

It may be some very small difference that is made by using those steps.

Jarland

same error:

s3cmd --version
s3cmd version 2.2.0
New settings:
  Access Key: xxxxxxxxxx
  Secret Key: xxxxxxxxxxxx
  Default Region: fra1
  S3 Endpoint: fra1.digitaloceanspaces.com
  DNS-style bucket+hostname:port template for accessing a bucket: %(bucket)s.nyc3.digitaloceanspaces.com
  Encryption password: secure_password
  Path to GPG program: /usr/bin/gpg
  Use HTTPS protocol: True
  HTTP Proxy server name:
  HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] Y
Please wait, attempting to list all buckets...
Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...
Success. Encryption and decryption worked fine :-)

Save settings? [y/N] y
Configuration saved to '/home/name/.s3cfg'
s3cmd mb s3://spacename3
ERROR: S3 error: 400 (XAmzContentSHA256Mismatch)

I did follow the setting documentation: https://docs.digitalocean.com/products/spaces/reference/s3cmd/

This is resolved by adding to the s3cfg file: signature_v2 = True

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.