You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I keep on getting a A client error (SignatureDoesNotMatch) occurred when calling the ListUsers operation: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
I set the environment variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION.
Reacted by Scott Stensland, Kevin Bloch, Arthur Burkart, Eliah Rusin, Ruan Carlos, Ish, Dominic Mokgakala, Adithya P Bhat, Louis Racicot, Pawel Wesolowski and 27 more
Reacted by Wojtek Wańczyk and Vladimir Sotnikov
Reacted by Marius Grigaitis, MNIII and Maksim Skutin
EDIT: If you are running into this issue, we'd appreciate your help in troubleshooting. I'm updating this comment for better visibility on troubleshooting steps.
Troubleshooting
The first step for troubleshooting this is to determine whether or not the issue is with the credentials themselves or with the CLI. To test this, try using these credentials in other AWS SDKs (javascript, ruby, java, etc). To help with this, I've created a test script that uses the AWS SDK for python and javascript which is available here: https://github.com/jamesls/aws-creds-test . After cloning, just run make install, make test. It will prompt you for credentials (similar to the CLI) and make an API call to sts.GetCallerIdentity.
/tmp $ mkdir /tmp/repro-cli-602
/tmp $ cd /tmp/repro-cli-602/
/tmp/repro-cli-602 $ git clone git://github.com/jamesls/aws-creds-test
Cloning into 'aws-creds-test'...
...
/tmp/repro-cli-602 $ cd aws-creds-test/
/tmp/repro-cli-602/aws-creds-test (master u=) $ make install
npm install
[email protected] /private/tmp/repro-cli-602/aws-creds-test
├─┬ [email protected]
...
pip install -r requirements.txt
Requirement already satisfied: botocore<2.0.0,>=1.5.0 in /usr/local/lib/python2.7/site-packages (from -r requirements.txt (line 1))
...
/tmp/repro-cli-602/aws-creds-test (master u=) $ make test
./test-creds.sh
Testing python...
Access Key:
Secret Access Key:
AKID hash: 4e7c36343646e1fa7495092bffcd4b9b7dd00f2f5014a189ab81f326e6472a62
AKID length: 20
SAK hash: 941a655993caccb1a1218883b97a88b6f41762c6d03902f1cdd1e2a5de5fd82e
SAK length: 40
Successfuly made an AWS request with the provided credentials.
Testing javasript...
Access Key: ********************
Secret Access Key: ****************************************
AKID hash: 4e7c36343646e1fa7495092bffcd4b9b7dd00f2f5014a189ab81f326e6472a62
AKID length: 20
SAK hash: 941a655993caccb1a1218883b97a88b6f41762c6d03902f1cdd1e2a5de5fd82e
SAK length: 40
Sucessfully made an AWS request with the provided credentials.
For people running into this issue, please run the test script and share the output.
This should give us better insight into where this issue is occurring:
If the above script passes for both python and javascript but is failing when using the CLI, likely a CLI issue.
If the script fails for python but passes for javascript, likely an issue with botocore (which the CLI uses).
If the above script fails for both python and javascript, likely an issue with the actual credentials.
Thanks in advance for anyone that can help us troubleshoot this issue. Let me know if there's any questions.
Reacted by Alex Emelyanov, Eliah Rusin, Will Clarke, Gene Linetsky, Nir Alfasi, aoummouden and Michael Richardson
I have a similar issue. Jenkins s3 plugin is able to put an object using my credentials, but the aws-cli is giving me the errors below.
aws s3 cp s3://my-bucket/folder/test.txt test.txt
A client error (Forbidden) occurred when calling the HeadObject operation: Forbidden Completed 1 part(s) with ... file(s) remaining
aws s3api get-object --bucket my-bucket --key folder/test.txt test.txt
A client error (SignatureDoesNotMatch) occurred when calling the GetObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.
I am running into the same issue. If I make up a secret it gives me a different (AuthFailure) error.
[[email protected]]]$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************AMKA env AWS_ACCESS_KEY_ID
secret_key ****************jPU2 env AWS_SECRET_ACCESS_KEY
region us-west-2 env AWS_DEFAULT_REGION
This is pretty much stopping me completely. I can do some things with the ec2-blah-stuff utilities by specifying x509 certs but the help says that's deprecated so I don't want to depend on it. Any help troubleshooting or what ever would really be appreciated.
They do not work with other tools (ec2-describe-instance for instance).
I think I have the appropriate rights since using the certs works. To make sure it's not a workstation thing I built an Amazon Linux instance and I'm using the awscli verison that comes with it but getting the same message.
Also an issue for me. I'm using it in a docker container, built with the same Dockerfile.
It works fine when built on an EC2, but does not work when built locally on a coreos vagrant box.
Reacted by Jason Haines, pirasakat, Eric Hodonsky, Nolan Emirot and Yuvraj Shekhawat
It looks like the issue is with the credentials themselves. I've double checked this, and I'm not able to repro this issue. Double check the credentials on the security credentials page. If someone can provide an exact set of steps that demonstrate the issue, I'd be happy to take another look.
Just had this happening to me and was a result of my system time being off by too much even though it did not report that. Ran ntpdate against pool.ntp.org and fixed this problem for me.
Reacted by David Brodigan, Bruce Xu, Mikhail Advani, Eric Brumfield, Bovard Doerschuk-Tiberi, chris, Shiva Kumar Avula, David Alejandro Parra, MJ (One Door), Andres Viana Gonzalez and 31 more
Reacted by Andres Viana Gonzalez, Eric Hodonsky, Dom Goodwin, Ankita Kumari, joelfogue, Vaughn B., Karol Oleszek, Jérôme and Ilia luk
Reacted by Andres Viana Gonzalez, Jesse Allport, Brian Candler, Max Schmidt, Sherif Abdalla, Paweł Prażak, Ankita Kumari, joelfogue, Tyler Gillson, Vaughn B. and 4 more
If you are in a virtual machine make sure your host os time matches the guest os time. If this is not the case you will get into the error you described.
Reacted by Lucian Corduneanu, Kevin Anderson, Zach Rosenberg, Lutsius Alex, pierupaa, Oreofe Olurin, Katrina DeVaney, Amanda, Alan Kash, JFKODJOU and 3 more
A very similar error occurs for me with good credentials, whilst listing a bucket which has a lot of keys in it. Here's the error:
A client error (SignatureDoesNotMatch) occurred when calling the ListObjects operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.
Here's my output from aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************4UNA shared-credentials-file
secret_key ****************MNOG shared-credentials-file
region <not set> None None
Note that these credentials work fine with other aws invocations, and in fact this list op runs for a long time (more than an hour) before bailing with this error. I have a file with over 82,000 lines of output in it from the command which eventually failed.
I've been getting this issue, and if I just sleep my script for a second and try again then it goes through. It's almost like it's getting throttled and returning the wrong error or something.
I am getting this same issue when using pre-signed URL returned to my client
The URL is generated in the server (for a limited time). The server is python and I don't see any error there, but the client is JS - only gets the URL and opens it. Part of the URL are generated credentials for this resource)
The error is on and off, so I think it is related to what is said here about special keys in the credentials, but since I am using credentials generated in the server - I cannot change them !
Any way to take care of this in the code ? parse the specials keys somehow ?
I am getting this same issue when using pre-signed URL returned to my client
The URL is generated in the server (for a limited time). The server is python and I don't see any error there, but the client is JS - only gets the URL and opens it. Part of the URL are generated credentials for this resource)
The error is on and off, so I think it is related to what is said here about special keys in the credentials, but since I am using credentials generated in the server - I cannot change them !
Any way to take care of this in the code ? parse the specials keys somehow ?
@maya-harel you can change the credentials from IAM -> users select user you have created and re-generate the secret key security credentials tab.
also timing in code is really fatal, for each request you make in back-end, get the current time to use it in header to generate the signature.
As an aside, there have been a lot of blind "regenerate your IAM credentials" suggestions to users who've explicitly said it's not an option for them.
This is not helpful to the users, and distracts from the fact that this is a known bug that continues to affect aws-cli users attempting to use valid IAM credentials.
Reacted by Maya Harel, Julian Poyourow, ObiH15, Weiming Zhu and Clinton Medbery
This has to be one of the most frustrating bugs I have encountered and it's nuts that it hasn't been fixed. Getting a cred without a "+" worked for me in CircleCI.
Yes, it is frustrating. My secret key that had a + didn't work in a Jenkins pipeline, but when I generated a new one, which only had a few of /, worked fine.
I had this issue on package installed version of awscli on Ubuntu 16.04. I fixed it by installing awscli as a python pip package.
For instructions, follow this link under section Installing AWS CLI using Python PIP
Encountered the InvalidSignatureException error after regenerating the Access Key
Partial Error log is as provided below.
$ python SetupAWS.py list_things
Traceback (most recent call last):
File "SetupAWS.py", line 222, in
list_things()
File "SetupAWS.py", line 182, in list_things
things = client.list_things()['things']
File "c:\Program Files (x86)\Python38-32\lib\site-packages\botocore-1.16.6-py3.8.egg\botocore\client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "c:\Program Files (x86)\Python38-32\lib\site-packages\botocore-1.16.6-py3.8.egg\botocore\client.py", line 626, in _make_api_call
raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidSignatureException) when calling the ListThings operation: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
Root Cause Analysis
As suggested by many in their comments above, the presence of "+" in my Secret Access Key was resulting in the above error.
Resolution
Generated new Access Key as an IAM User and verified that the new Secret Access Key does not contain a "+" within the string.
Ran the aws configure command and provided the new values.
Ran the python SetupAWS.py list_things command, which successfully listed my thing, as shown below,
This issue has been open for six years, and I thank you for your patience, persistence, and the information you have provided. A few underlying causes have been identified through your comments (#602 (comment)) and compiled into the Command Line User Guide Troubleshooting Errors chapter. These causes include clock skew and some operating systems mishandling keys with special characters.
I attempted to reproduce this using a number of different environments. I used Ubuntu 16.04, Ubuntu 18.04, and Amazon Linux 2, with Python 3.6.8 and 3.8.3. While many commenters used Python 2, I did not attempt to reproduce since it is no longer supported. I used the latest v1 aws-cli (1.18.80 at the time of writing) as well as an older version (1.11.78) referenced in this issue. I used the script provided (#602 (comment)) by @jamesls that creates new credential pairs until it encounters one with special characters and let them run for up to an hour each. I did not have any occurrences of a SignatureDoesNotMatch error. I received occasional AuthFailure errors on the describe-instances command, but a retry of the command with the same credentials succeeds.
The large number of comments makes it difficult for new users coming to this issue to find requests from our developer team for troubleshooting suggestions. To assist our team and the community in determining a cause of this error, I am closing this issue.
Due to the variation of user environments where this error occurs, please file a separate issue instead of commenting on an existing one.
Activity
jamesls commentedon Jan 22, 2014
EDIT: If you are running into this issue, we'd appreciate your help in troubleshooting. I'm updating this comment for better visibility on troubleshooting steps.
Troubleshooting
The first step for troubleshooting this is to determine whether or not the issue is with the credentials themselves or with the CLI. To test this, try using these credentials in other AWS SDKs (javascript, ruby, java, etc). To help with this, I've created a test script that uses the AWS SDK for python and javascript which is available here: https://github.com/jamesls/aws-creds-test . After cloning, just run
make install,make test. It will prompt you for credentials (similar to the CLI) and make an API call tosts.GetCallerIdentity.For people running into this issue, please run the test script and share the output.
This should give us better insight into where this issue is occurring:
Thanks in advance for anyone that can help us troubleshoot this issue. Let me know if there's any questions.
thomaswitt commentedon Jan 23, 2014
This is how it looks like:
foscraig commentedon Apr 4, 2014
Any updates on this issue? I'm also encountering this error and my credentials file hasn't changed.
squirvoid commentedon Apr 28, 2014
I have a similar issue. Jenkins s3 plugin is able to put an object using my credentials, but the aws-cli is giving me the errors below.
JeremyShort commentedon May 14, 2014
I am running into the same issue. If I make up a secret it gives me a different (AuthFailure) error.
This is pretty much stopping me completely. I can do some things with the ec2-blah-stuff utilities by specifying x509 certs but the help says that's deprecated so I don't want to depend on it. Any help troubleshooting or what ever would really be appreciated.
jamesls commentedon May 14, 2014
The first step would be to ensure that your access/secret keys are actually valid. A few things to try:
JeremyShort commentedon May 15, 2014
They do not work with other tools (ec2-describe-instance for instance).
I think I have the appropriate rights since using the certs works. To make sure it's not a workstation thing I built an Amazon Linux instance and I'm using the awscli verison that comes with it but getting the same message.
TeePaps commentedon Jul 16, 2014
Also an issue for me. I'm using it in a docker container, built with the same Dockerfile.
It works fine when built on an EC2, but does not work when built locally on a coreos vagrant box.
jamesls commentedon Jul 28, 2014
It looks like the issue is with the credentials themselves. I've double checked this, and I'm not able to repro this issue. Double check the credentials on the security credentials page. If someone can provide an exact set of steps that demonstrate the issue, I'd be happy to take another look.
rvfn commentedon Aug 1, 2014
Just had this happening to me and was a result of my system time being off by too much even though it did not report that. Ran ntpdate against pool.ntp.org and fixed this problem for me.
anuraj-optimizely commentedon Oct 14, 2014
If you are getting this error when cred are setup using env variable, try sudo
rcosnita commentedon Oct 24, 2014
If you are in a virtual machine make sure your host os time matches the guest os time. If this is not the case you will get into the error you described.
j0ni commentedon Nov 3, 2014
A very similar error occurs for me with good credentials, whilst listing a bucket which has a lot of keys in it. Here's the error:
Here's my output from
aws configure listNote that these credentials work fine with other
awsinvocations, and in fact thislistop runs for a long time (more than an hour) before bailing with this error. I have a file with over 82,000 lines of output in it from the command which eventually failed.aub commentedon Nov 14, 2014
I've been getting this issue, and if I just sleep my script for a second and try again then it goes through. It's almost like it's getting throttled and returning the wrong error or something.
154 remaining items
FathyRida commentedon Apr 12, 2020
I had this issue, I suggest you to generate new keys
and re-configure your aws profile
aws configure
AWS Access Key ID [****************QD5E]: AWS_ACCESS_KEY_ID
AWS Secret Access Key [****************ANjA]: AWS_SECRET_ACCESS_KEY
Default region name [eu-west-3]: AWS_REGION
Default output format [json]: OUTPUT_FORMAT
maya-harel commentedon May 9, 2020
Hi !
I am getting this same issue when using pre-signed URL returned to my client
The URL is generated in the server (for a limited time). The server is python and I don't see any error there, but the client is JS - only gets the URL and opens it. Part of the URL are generated credentials for this resource)
The error is on and off, so I think it is related to what is said here about special keys in the credentials, but since I am using credentials generated in the server - I cannot change them !
Any way to take care of this in the code ? parse the specials keys somehow ?
Ash-Mokhtar commentedon May 9, 2020
@maya-harel you can change the credentials from IAM -> users select user you have created and re-generate the secret key security credentials tab.
also timing in code is really fatal, for each request you make in back-end, get the current time to use it in header to generate the signature.
penryu commentedon May 9, 2020
As an aside, there have been a lot of blind "regenerate your IAM credentials" suggestions to users who've explicitly said it's not an option for them.
This is not helpful to the users, and distracts from the fact that this is a known bug that continues to affect aws-cli users attempting to use valid IAM credentials.
golharam commentedon May 14, 2020
Running into this as well.
$ aws --version
aws-cli/1.16.300 Python/2.7.16 Linux/4.14.152-127.182.amzn2.x86_64 botocore/1.13.36
My keys are completely alpha-numeric, no special characters.
The keys work from the shell, however when used via Jenkins in a Makefile target, this error occurs. Not sure what is happening here.
KeeonTabrizi commentedon May 23, 2020
My secret key has both
/and+in it. Running into this issue and have tried:> aws iam get-user(using~/.aws/credentialsfile)boto3.Session(profile_name=PROFILE)(which pulls from ~/.aws/credentials)All of these result in the
SignatureDoesNotMatcherror.I currently cannot regenerate the key.
What I don't understand is that I can use the S3 Protocol in Cyberduck (https://cyberduck.io/) and it works as expected. How could that be?
clintonmedbery commentedon May 28, 2020
This has to be one of the most frustrating bugs I have encountered and it's nuts that it hasn't been fixed. Getting a cred without a "+" worked for me in CircleCI.
manel00 commentedon Jun 5, 2020
Is it still crashing? facing the same problem, wow i cannot be possible...
rcmelendez commentedon Jun 10, 2020
Yes, it is frustrating. My secret key that had a
+didn't work in a Jenkins pipeline, but when I generated a new one, which only had a few of/, worked fine.georgesamy commentedon Jun 11, 2020
I had this issue on package installed version of awscli on Ubuntu 16.04. I fixed it by installing awscli as a python pip package.
For instructions, follow this link under section Installing AWS CLI using Python PIP
dipen-1337lab commentedon Jun 16, 2020
Issue Encountered
$ python SetupAWS.py list_things
Traceback (most recent call last):
File "SetupAWS.py", line 222, in
list_things()
File "SetupAWS.py", line 182, in list_things
things = client.list_things()['things']
File "c:\Program Files (x86)\Python38-32\lib\site-packages\botocore-1.16.6-py3.8.egg\botocore\client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "c:\Program Files (x86)\Python38-32\lib\site-packages\botocore-1.16.6-py3.8.egg\botocore\client.py", line 626, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidSignatureException) when calling the ListThings operation: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
Root Cause Analysis
Resolution
$ python SetupAWS.py list_things
[{'thingName': 'myThingName', 'thingArn': 'myThingArn', 'attributes': {}, 'version': 1}]
kdaily commentedon Jun 24, 2020
This issue has been open for six years, and I thank you for your patience, persistence, and the information you have provided. A few underlying causes have been identified through your comments (#602 (comment)) and compiled into the Command Line User Guide Troubleshooting Errors chapter. These causes include clock skew and some operating systems mishandling keys with special characters.
I attempted to reproduce this using a number of different environments. I used Ubuntu 16.04, Ubuntu 18.04, and Amazon Linux 2, with Python 3.6.8 and 3.8.3. While many commenters used Python 2, I did not attempt to reproduce since it is no longer supported. I used the latest v1 aws-cli (1.18.80 at the time of writing) as well as an older version (1.11.78) referenced in this issue. I used the script provided (#602 (comment)) by @jamesls that creates new credential pairs until it encounters one with special characters and let them run for up to an hour each. I did not have any occurrences of a
SignatureDoesNotMatcherror. I received occasionalAuthFailureerrors on the describe-instances command, but a retry of the command with the same credentials succeeds.The large number of comments makes it difficult for new users coming to this issue to find requests from our developer team for troubleshooting suggestions. To assist our team and the community in determining a cause of this error, I am closing this issue.
Due to the variation of user environments where this error occurs, please file a separate issue instead of commenting on an existing one.