AWS ECS/EC2 任务部署失败

问题描述 投票:0回答:1
我正在尝试使用 ECS 将一个小型 React 应用程序部署到 EC2 实例,但我不断收到错误消息

Resource handler returned message: "Error occurred during operation 'ECS Deployment Circuit Breaker was triggered'." (RequestToken: xxx-xxx-xxx-xxx, HandlerErrorCode: GeneralServiceException)


我尝试手动将应用程序部署到 EC2 实例(使用

docker run -p 80:3000 my-app

),效果很好,所以我很确定应用程序和 Dockerfile 都正常。 Docker 镜像托管在 ECR 中。

我认为这很可能是我的任务定义的问题。看起来像这样:

{ "taskDefinitionArn": "arn:aws:ecs:eu-north-1:xxx:task-definition/my-task-definition:4", "containerDefinitions": [ { "name": "my-app", "image": "xxx.dkr.ecr.eu-north-1.amazonaws.com/my-app:latest", "cpu": 1024, "memory": 1024, "portMappings": [ { "name": "my-app-3000-tcp", "containerPort": 3000, "hostPort": 80, "protocol": "tcp" } ], "essential": true, "environment": [], "mountPoints": [], "volumesFrom": [], "disableNetworking": false, "privileged": false, "readonlyRootFilesystem": false, "pseudoTerminal": false } ], "family": "my-app", "taskRoleArn": "arn:aws:iam::xxx:role/EcsToEcrAccess", "executionRoleArn": "arn:aws:iam::xxx:role/ecsTaskExecutionRole", "networkMode": "bridge", "revision": 4, "volumes": [], "status": "ACTIVE", "requiresAttributes": [ { "name": "com.amazonaws.ecs.capability.ecr-auth" }, { "name": "com.amazonaws.ecs.capability.task-iam-role" }, { "name": "ecs.capability.execution-role-ecr-pull" } ], "placementConstraints": [], "compatibilities": [ "EC2" ], "requiresCompatibilities": [ "EC2" ], "registeredAt": "2023-01-31T15:30:16.919Z", "registeredBy": "arn:aws:iam::xxx:user/me", "tags": [ { "key": "ecs:taskDefinition:createdFrom", "value": "ecs-console-v2" } ] }
    
amazon-web-services docker amazon-ec2 amazon-ecs amazon-ecr
1个回答
0
投票
我也有同样的问题。不知道如何以及在哪里找到解决方案。 问题是失败的原因不可见。我知道应该有日志或比错误名称更多的东西,它不提供任何信息。

© www.soinside.com 2019 - 2024. All rights reserved.