ECS hangs when deploying new service on cluster

0

Hello! I've been battling ECS all day, and I've finally given up and I'm posting here. I'm trying to set up a cluster that runs one of my APIs in one container, and a staging container for the same API in another. Provisioning the cluster and creating a task definition works fine, but when I go and deploy the service, it will hang forever. I left it to sit for over 30 minutes on one of my attempts and no dice. Looking in CloudFormation, the only thing in the stack that succeeds is creating a security group, and the rest all sit on "CREATE_IN_PROGESS" and never do anything. The API i'm trying to deploy is built on NextJS API routes, and it's hosted on ECR. For the infrastructure, I chose EC2 over Fargate (just because I prefer it.) I did write a Dockerfile for it, but I don't think that should be interfering, should it? If you need more info, I'm happy to provide.

Thank you!

  • While the CloudFormation is showing CREATE_IN_PROGESS, what is showing on ECS Service events? Also, you've mentioned that "I did write a Dockerfile for it". What do you mean? I'm supposing that you've build the image and pushed to ECR.

    Also, since you are using ECS with EC2, can you please check if the EC2 is registered to the ECS Cluster?

    1. The events just says "pending" This is what the events say
    2. I misunderstood something when i wrote the post. I wrote a dockerfile, built the image, and pushed it to ECR.
    3. The instance is registered with the ECS cluster. It was the same instance that was provisioned when the cluster was deployed

    @Henrique Santana

  • NOTE: I tested the same container on Fargate and it worked just fine.

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions