【问题标题】:Boto3 / ECR-Public errorsBoto3 / ECR-公共错误
【发布时间】:2021-09-25 06:10:48
【问题描述】:

我正在尝试使用 ecr-public 客户端,但在执行任何方法时都会遇到类似的错误。

import boto3
client=boto3.client('ecr-public')
client.get_authorization_token()

错误:botocore.exceptions.ClientError:调用 GetAuthorizationToken 操作时发生错误(InternalFailure)(达到最大重试次数:4):

client.create_repository(repositoryName="test-project")

错误:botocore.exceptions.ClientError:调用 CreateRepository 操作时发生错误(InternalFailure)(达到最大重试次数:4):

我的用户拥有完整的 AWS 管理员权限,如果我从客户端类型 ecr-public 更改为 ecr,它可以工作。

【问题讨论】:

  • 您能确认您使用的是us-east-1 区域吗?
  • 我正在使用 us-west-2
  • 您必须使用us-east-1。只有该地区支持公共 ecr。你能用client=boto3.client('ecr-public', region_name='us-east-1')运行命令吗?
  • 成功了!谢谢!
  • 很高兴听到这个消息。如果你不介意,我会回答的。

标签: python python-3.x amazon-web-services boto3 amazon-ecr-public


【解决方案1】:

基于 cmets。

ecr-public 只能用于us-east-1 区域。因此,您必须为该区域设置 client

client=boto3.client('ecr-public', region_name='us-east-1')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-23
    • 1970-01-01
    • 2020-09-27
    • 2019-01-20
    • 2018-03-01
    • 2014-08-15
    • 2016-04-16
    • 1970-01-01
    相关资源
    最近更新 更多