【发布时间】:2020-08-11 07:03:41
【问题描述】:
我使用 AWS CodePipeline 在 Elastic Beanstalk 上部署多容器 docker 应用程序。该应用程序需要从 EFS 附加文件系统作为已安装的卷。为了附加并访问该卷,看来我需要重新启动 docker。这个问题解释了这一点:Using AWS EFS with Docker。虽然我可以根据这些说明成功附加文件系统,但我的部署有时会“失败”并出现以下错误:
Action execution failed Deployment completed, but with errors: ECS task stopped due to: Task failed to start. Failed to start ECS task: arn:aws… is STOPPED.
在这些情况下,应用程序成功部署,并且功能齐全,但我收到一条失败消息,因为在检查期间 docker 尚未重新启动。
发生这种情况时,我在 Beanstalk 日志中看到以下内容:
-------------------------------------
/var/log/ecs/ecs-init.log
-------------------------------------
2020-04-27T15:06:41Z [INFO] pre-start
2020-04-27T15:06:44Z [INFO] start
2020-04-27T15:06:44Z [INFO] No existing agent container to remove.
2020-04-27T15:06:44Z [INFO] Starting Amazon Elastic Container Service Agent
2020-04-27T15:07:20Z [INFO] Agent exited with code 0
2020-04-27T15:07:20Z [INFO] Error connecting to docker, backing off for 1.14777941s, error: Get http://unix.sock/v1.25/version: dial unix /var/run/docker.sock: connect: no such file or directory
2020-04-27T15:07:21Z [INFO] Error connecting to docker, backing off for 2.282153551s, error: Get http://unix.sock/v1.25/version: dial unix /var/run/docker.sock: connect: no such file or directory
2020-04-27T15:07:23Z [INFO] post-stop
2020-04-27T15:07:23Z [INFO] Cleaning up the credentials endpoint setup for Amazon Elastic Container Service Agent
2020-04-27T15:07:23Z [INFO] pre-start
2020-04-27T15:07:23Z [INFO] start
2020-04-27T15:07:23Z [INFO] Container name: /ecs-agent
2020-04-27T15:07:23Z [INFO] Removing existing agent container ID:
2020-04-27T15:07:23Z [INFO] Starting Amazon Elastic Container Service Agent
有没有办法防止这些错误的失败?
【问题讨论】:
标签: amazon-web-services amazon-elastic-beanstalk aws-codepipeline amazon-efs