AWS S3 - How to fix 'The request signature we calculated does not match the signature' error?

后端 未结 30 2587
谎友^
谎友^ 2020-11-29 08:05

I have searched on the web for over two days now, and probably have looked through most of the online documented scenarios and workarounds, but nothing worked for me so far.

相关标签:
30条回答
  • 2020-11-29 08:35

    I encountered this in a Docker image, with a non-AWS S3 endpoint, when using the latest awscli version available to Debian stretch, i.e. version 1.11.13.

    Upgrading to CLI version 1.16.84 resolved the issue.

    To install the latest version of the CLI with a Dockerfile based on a Debian stretch image, instead of:

    RUN apt-get update
    RUN apt-get install -y awscli
    RUN aws --version
    

    Use:

    RUN apt-get update
    RUN apt-get install -y python-pip
    RUN pip install awscli
    RUN aws --version
    
    0 讨论(0)
  • 2020-11-29 08:36

    Got this error while uploading document to CloudSearch through Java SDK. The issue was because of a special character in the document to be uploaded. The error "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method." is very misleading.

    0 讨论(0)
  • 2020-11-29 08:37

    Another possible issue might be that the meta values contain non US-ASCII characters. For me it helped to UrlEncode the values when adding them to the putRequest:

    request.Metadata.Add(AmzMetaPrefix + "artist", HttpUtility.UrlEncode(song.Artist));
    request.Metadata.Add(AmzMetaPrefix + "title", HttpUtility.UrlEncode(song.Title));
    
    0 讨论(0)
  • 2020-11-29 08:38

    If none of the other mentioned solution works for you , then try using

    aws configure
    

    this command will open a set of options asking for keys, region and output format.

    Hope this helps!

    0 讨论(0)
  • 2020-11-29 08:39

    In my case I parsed an S3 url into its components.

    For example:

    Url:    s3://bucket-name/path/to/file
    

    Was parsed into:

    Bucket: bucket-name
    Path:   /path/to/file
    

    Having the path part containing a leading '/' failed the request.

    0 讨论(0)
  • 2020-11-29 08:39

    In my case the bucketname was wrong, it included the first part of the key (bucketxxx/keyxxx) - there was nothing wrong with the signature.

    0 讨论(0)
提交回复
热议问题