Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS - ECS run a task show this error Reasons : ["RESOURCE:PORTS"]

When I try run a task in my service using ECS a errors message is displayed

Run tasks failed Reasons : ["RESOURCE:PORTS"]

How can I resolve this issue?

like image 630
Bruno Quaresma Avatar asked Apr 30 '17 00:04

Bruno Quaresma


People also ask

Why did my ECS Task stop?

Your Amazon ECS tasks might stop due to a variety of reasons. The most common reasons are: Essential container exited. Failed Elastic Load Balancing (ELB) health checks.

How do I connect to an ECS task?

To connect to your container instanceOpen the Amazon ECS console at https://console.aws.amazon.com/ecs/ . Select the cluster that hosts your container instance. On the Cluster page, choose ECS Instances. On the Container Instance column, select the container instance to connect to.

Can an ECS Task have multiple containers?

You can use an Amazon ECS task definition to specify multiple containers. All the containers that you specify are deployed along the same compute capacity. Don't use this feature to add multiple application containers to the same task definition because this prevents copies of each application scaling separately.


2 Answers

It looks like the scheduler cannot assign your task to an instance because it requires a fixed port that is already taken. The simplest solution is to choose another port number in the specification of your task.

You could also allow the scheduler to allocate the port dynamically, but in this case you would probably want to define a service attached to a load balancer in order to expose it to the outside world.

like image 183
Adam Byrtek Avatar answered Sep 19 '22 10:09

Adam Byrtek


I had one instance running and I was ssh'ed into it and got this error.

I logged out and I was able to run the task.

like image 43
Michael Davidson Avatar answered Sep 22 '22 10:09

Michael Davidson