aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

aws s3 sync consistently fails to fetch some objects with SignatureDoesNotMatch

Open tjb801 opened this issue 7 years ago • 4 comments

aws s3 sync consistently fails to fetch some objects with SignatureDoesNotMatch:

$ aws s3 sync s3://aws-quickstart/quickstart-amazon-eks/ . |& grep failed download failed: s3://aws-quickstart/quickstart-amazon-eks/functions/packages/Helm/lambda.zip to functions\packages\Helm\lambda.zip An error occurred (SignatureDoesNotMatch) when calling the GetObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method. download failed: s3://aws-quickstart/quickstart-amazon-eks/functions/packages/KubeGet/lambda.zip to functions\packages\KubeGet\lambda.zip An error occurred (SignatureDoesNotMatch) when calling the GetObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method. download failed: s3://aws-quickstart/quickstart-amazon-eks/functions/packages/KubeManifest/lambda.zip to functions\packages\KubeManifest\lambda.zip An error occurred (SignatureDoesNotMatch) when calling the GetObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.

(These objects are the exceptions; 74 objects were fetched successfully.)

These errors occur on the same objects every time.

$ aws --version aws-cli/1.16.144 Python/3.6.0 Windows/10 botocore/1.12.134

tjb801 avatar Apr 24 '19 20:04 tjb801

@tjb801 - Thanks for reporting th SignatureDoesNotMatch error. I was able to reproduce this error with an invalid and with an expired Access and Secret Key. It was resolved by generating new keys. If you know the IAM user running the the s3 Sync command, the following command will list the Access key without the Secret key and determine if any are inactive:

aws iam list-access-keys --user-name JaneDoe

{ "AccessKeyMetadata": [ { "UserName": "JaneDoe", "AccessKeyId": "ABCDEFGACCESSKEY", "Status": "Active", "CreateDate": "2019-05-09T00:05:51Z" }, { "UserName": "JaneDoe", "AccessKeyId": "STUVWXYZACCESSKEY", "Status": "Inactive", "CreateDate": "2019-01-27T23:33:10Z" } ] }

Credentials can be stored in several ways:

As such, credentials from environment variables have precedence over credentials from the shared credentials and AWS CLI config file. Credentials specified in the shared credentials file have precedence over credentials in the AWS CLI config file. If AWS_PROFILE environment variable is set and the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables are set, then the credentials provided by AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY will override the credentials located in the profile provided by AWS_PROFILE.

If this does not resolve the problem then it is recommended to compare the permissions and policies on the objects that are failing and provide steps I can use to reproduce the problem.

justnance avatar May 09 '19 00:05 justnance

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

no-response avatar Jun 21 '19 14:06 no-response

@tjb801 - Due to inactivity this issue will be closed. If there is still an issue, please open a new issue and provide the output of the --debug options so that we can investigate further.

justnance avatar Jun 25 '19 01:06 justnance

@justnance , I have valid access and secret key. I am able to download txt or csv file but can't download zip or jar or other kinds of file. It always giving SignatureDoesNotMatch error.

Any idea to fix it?

abser avatar Aug 28 '19 07:08 abser