大网数据广告活动
服务器运维问答

AWS ECS Task is stuck at PROVISIONING

· 52CE 我爱测

I have an ECS Cluster with a capacity provider and a service. The capacity provider runs an autoscale group, and when one instance of this group starts, at the end I can see that there are ECS instances avalaible. Actually, I can…

问题原文

原帖链接 · Learning from masters · CC BY-SA 4.0

I have an ECS Cluster with a capacity provider and a service. The capacity provider runs an autoscale group, and when one instance of this group starts, at the end I can see that there are ECS instances avalaible. Actually, I can connect to them through SSH.

The service also runs well, since it creates a new task which is based on a docker image at ERS repository. However, the task never pass from "PROVISIONING", and if I open the task I can see that the container of the task is void and loading. If I enter into my instance, I see the same docker instance if I do docker ps or docker ps -a. If I execute the agent docker exec id_docker /agent I see:

level=info time=2022-05-02T21:16:05Z msg="Successfully got ECS instance credentials from provider: EC2RoleProvider" module=instancecreds.go
level=info time=2022-05-02T21:16:05Z msg="Starting Amazon ECS Agent" version="1.61.0" commit="05730614"
level=info time=2022-05-02T21:16:05Z msg="Loading configuration"
level=info time=2022-05-02T21:16:05Z msg="Successfully got ECS instance credentials from provider: EC2RoleProvider" module=instancecreds.go

If I try with docker exec id_docker bash I get an error:

OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "bash": executable file not found in $PATH: unknown

What's happening here? Any clue?

已采纳解答

原帖链接 · Learning from masters · CC BY-SA 4.0

What I had after doing docker ps wsa in fact ecs-agent, which is something Amazon creates to control the container. That was the stucked part. My docker wasn't even running in fact.

To solve it, when you create the task, in the container options, when you select the ports of the container to redirect to the host, put in your host values a 0. E.g, redirect port 22 to 22 -> 0 to 22. This is a dynamic port mapping in ecs.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-05-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。