Reputation: 5073
I went through the quickstart located here: https://boto3.readthedocs.io/en/latest/guide/quickstart.html
I installed the AWS CLI and configured it with my valid keys. I've double checked in the ~/.aws/credentials and ~/.aws/config
At this point I should be able to run my py script with python bin/process_sqs_messages.py
at the command prompt. The script looks like this:
__author__ = 'chris'
import boto3
sqs = boto3.client('sqs')
# List SQS queues
response = sqs.list_queues()
print(response['QueueUrls'])
I get the following error:
botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId)
when calling the ListQueues operation: No account found for the given parameters
Full stack trace:
Traceback (most recent call last):
File "bin/process_sqs_messages.py", line 12, in <module>
response = client.list_queues()
File "/Users/xxxx/.environments/xxxx_env/lib/python3.6/site-packages/botocore/client.py", line 310, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Users/xxxxx/.environments/xxxxx_env/lib/python3.6/site-packages/botocore/client.py", line 599, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) when calling the ListQueues operation: No account found for the given parameters
My guess is that i'm missing a session token, but i'm not sure and if I am where/how do I get one? The sample doesn't mention it at all.
Upvotes: 4
Views: 10719
Reputation: 195
In my case, I created new users/keys but it didn't work. Also, I double-checked the following.
It was my old terminal that was causing the problem(which I didn't shut nearly for weeks) so After closing it, I just relaunched it and it worked perfectly fine.
Upvotes: 0
Reputation: 5073
I just created a new user and magically they work again. Must have had my credentials invalidated somewhere, but that user still existed and that user's credentials matched inside awscli.
Upvotes: 1