Reputation: 1
Hy, i got some problem when do deployment on AWS ECS using approach docker deployment, in this case i already deploy my docker image with AWS ECR.
The Problem is when i deploy using service AWS ECS, it return "Essential container in task exited ".
I'm not sure how to tracing the log and figure it out the Error here.
I was setup my awslog, but there's no logger error there
Here my task.json
{ "taskDefinitionArn": "arn:aws:ecs:ap-southeast-2:625875865989:task-definition/docker-api-task:6", "containerDefinitions": [ { "name": "backendContainer", "image": "625875865989.dkr.ecr.ap-southeast-2.amazonaws.com/imember-app-backend:latest", "cpu": 0, "portMappings": [ { "name": "backend-api-port", "containerPort": 3000, "hostPort": 0, "protocol": "tcp", "appProtocol": "http" } ], "essential": true, "environment":[], "mountPoints": [], "volumesFrom": [], "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-create-group": "true", "awslogs-group": "/ecs/docker-api-task", "awslogs-region": "ap-southeast-2", "awslogs-stream-prefix": "ecs" } }, "systemControls": [] } ], "family": "docker-api-task", "taskRoleArn": "arn:aws:iam::625875865989:role/ecsTaskExecutionRole", "executionRoleArn": "arn:aws:iam::625875865989:role/ecsTaskExecutionRole", "revision": 6, "volumes": [], "status": "ACTIVE", "requiresAttributes": [ { "name": "com.amazonaws.ecs.capability.logging-driver.awslogs" }, { "name": "ecs.capability.execution-role-awslogs" }, { "name": "com.amazonaws.ecs.capability.ecr-auth" }, { "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19" }, { "name": "com.amazonaws.ecs.capability.task-iam-role" }, { "name": "ecs.capability.execution-role-ecr-pull" }, { "name": "com.amazonaws.ecs.capability.docker-remote-api.1.29" } ], "placementConstraints": [], "compatibilities": [ "EC2" ], "requiresCompatibilities": [ "EC2" ], "cpu": "1024", "memory": "3072", "runtimePlatform": { "cpuArchitecture": "X86_64", "operatingSystemFamily": "LINUX" }, "registeredAt": "2024-03-19T03:09:40.965Z", "registeredBy": "arn:aws:iam::625875865989:user/sl-imember-iam", "tags": [] }
Will apreciate it if you can addressing my problem, Thank you!
Deploying using task AWS ECS , but the deployment still not runnning
well
Upvotes: 0
Views: 169
Reputation: 51
points to check:
Ensure that the Docker image you are using is built correctly and includes all necessary dependencies.
Test the Docker image locally to see if it runs as expected on your development environment.
Verify that your ECS task execution role (ecsTaskExecutionRole) has the necessary permissions to pull the Docker image from ECR and write logs to CloudWatch Logs.
Ensure that any security groups or IAM policies are not blocking the necessary network traffic.
Verify that your task definition is correctly configured. Make sure the container definition, including the image name and essential flag, is accurate. For example you have put "cpu": 0,
Check if the CPU and memory resources allocated to the task are sufficient for your application.
Upvotes: 0