已停止(CannotPullContainerError:API错误(500)? [英] STOPPED (CannotPullContainerError: API error (500)?

查看:149
本文介绍了已停止(CannotPullContainerError:API错误(500)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Amazon Fargate集群上运行任务时遇到此错误.有人见过这个吗?

I'm getting this error when running a task on my Amazon Fargate cluster. Has anyone seen run into this before?

推荐答案

转到文档以获取对此答案.

Go to the docs for an answer to this one.

https://docs.aws.amazon.com/AmazonECS/最新/developerguide/task_cannot_pull_image.html

由于遇到500错误,我会留意第一个错误的描述连接超时"的建议:

Since you are encountering a 500 error, I would heed the advice of the first error's description, "Connection timed out":

启动Fargate任务时,其弹性网络接口需要一条通往Internet的路由来提取容器图像.如果启动任务时收到与以下类似的错误,则是因为不存在通往Internet的路由:

When a Fargate task is launched, its elastic network interface requires a route to the internet to pull container images. If you receive an error similar to the following when launching a task, it is because a route to the internet does not exist:

CannotPullContainerError: API error (500): Get https://111122223333.dkr.ecr.us-east-1.amazonaws.com/v2/: net/http: request canceled while waiting for connection

要解决此问题,您可以:

To resolve this issue, you can:

  • 对于公共子网中的任务,在启动任务时为自动分配公共IP 指定已启用.

对于专用子网中的任务,在启动任务时为自动分配公用IP 指定 DISABLED ,并在VPC中配置NAT网关以路由请求上网...

For tasks in private subnets, specify DISABLED for Auto-assign public IP when launching the task, and configure a NAT Gateway in your VPC to route requests to the internet...

如果遇到与ECS任务未启动或启动时表现出怪异行为有关的任何其他问题,请检查

If you encountering any other issues relating to ECS Tasks not starting or exhibiting weird behavior upon starting, then check the full list of ECS troubleshooting topics.

我遇到了类似的错误(404而不是500),但是,即使详细状态列出了错误,任务也显示它正在运行.

I was encountering a similar error (404 instead of 500), however, the Task displayed that it was RUNNING even though the detailed status listed an error.

事实证明,ecs-tasks无法承担与任务关联的角色(在这种情况下,角色与其运行的EC2实例相同).在角色中添加以下信任关系语句即可解决此问题:

It turns out that the role associated with the task (same role as the EC2 Instance on which it was running, in this case) could not be assumed by ecs-tasks. Adding the following trust relationship statement to the role resolved the issue:

{
  "Effect": "Allow",
  "Principal": {
    "Service": "ecs-tasks.amazonaws.com"
  },
  "Action": "sts:AssumeRole"
}

请参见任务执行角色上的特定页面更多细节.

See the specific page on the Task Execution Roles for more details.

这篇关于已停止(CannotPullContainerError:API错误(500)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆