AWS ECS service not starting any tasks

9,142

I'd check your Events tab in the ECS service. In some cases it will tell you there isn't enough memory to start the container. It's a bit tricky to find without knowing, since it's buried in a tab within the service. I'd expect some events must have occured.

Share:
9,142
Jack3311
Author by

Jack3311

Updated on September 18, 2022

Comments

  • Jack3311
    Jack3311 over 1 year

    I've set up a cluster, container, task and service on ECS.

    After I created the service, it appears to be running with '3 desired tasks', however no tasks are being created as pending or running. Effectively it seems to be doing nothing.

    My task definition (excluding nulls and empty arrays) is

    {
      "containerDefinitions": [
        {
          "portMappings": [
            {
              "hostPort": 5000,
              "protocol": "tcp",
              "containerPort": 25565
            },
            {
              "hostPort": 5000,
              "protocol": "udp",
              "containerPort": 25565
            }
          ],
          "cpu": 0,
          "memoryReservation": 1024,
          "image": "itzg/bungeecord",
          "essential": true,
          "name": "BungeeCord"
        }
      ],
      "compatibilities": [
        "EC2"
      ],
      "taskDefinitionArn": "arn:aws:ecs:us-west-1:949960343466:task-definition/BungeeCordTask:3",
      "family": "BungeeCordTask",
      "requiresAttributes": [
        {
          "name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
        }
      ],
      "requiresCompatibilities": [
        "EC2"
      ],
      "revision": 3,
      "status": "ACTIVE",
    }
    

    My cluster has 3 ECS instances, which are all running and have nothing on them: My cluster

    My service is here: My service

    I don't have any auto-scaling, load balancing or anything set up. But I do have some really default service discovery.

    Anybody have any ideas why no tasks are starting?

    Edit:

    • I've had a look at the "Stopped tasks" and it's actually empty.
    • I also SSH'd into each of my ec2 instances, and had a look through /var/log: I found a folder /var/log/ecs with some log files, but there are no errors or anything relating to my task specifically. It seems to be successfully polling a amazon web endpoint for updates.
    • I also ran curl google.com to verify that they have external access.
    • Admin
      Admin over 4 years
      What does CloudTrail says?
    • Admin
      Admin about 4 years
      Just wondering if you found a solution to this problem, I've facing the same issue.
  • Jack3311
    Jack3311 over 4 years
    Hi, thanks for your response :) Please check my edits to the question.