gpt4 book ai didi

amazon-web-services - botocore.exceptions.ClientError : InvalidClientTokenId

转载 作者:行者123 更新时间:2023-12-05 06:38:54 24 4
gpt4 key购买 nike

我浏览了位于此处的快速入门:https://boto3.readthedocs.io/en/latest/guide/quickstart.html

我安装了 AWS CLI 并使用我的有效 key 对其进行了配置。我已经仔细检查了 ~/.aws/credentials 和 ~/.aws/config

此时我应该能够在命令提示符下使用 python bin/process_sqs_messages.py 运行我的 py 脚本。脚本如下所示:

__author__ = 'chris'
import boto3

sqs = boto3.client('sqs')

# List SQS queues
response = sqs.list_queues()

print(response['QueueUrls'])

我收到以下错误:

botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) 
when calling the ListQueues operation: No account found for the given parameters

完整堆栈跟踪:

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

我的猜测是我丢失了一个 session token ,但我不确定,如果我在哪里/如何获得一个?样本根本没有提到它。

最佳答案

我刚刚创建了一个新用户,他们神奇地再次工作了。一定是我的凭据在某处失效了,但该用户仍然存在并且该用户的凭据在 awscli 中匹配。

关于amazon-web-services - botocore.exceptions.ClientError : InvalidClientTokenId,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45378453/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com