ECS Service Creation is Taking too much Time

0

I am trying to create an ECS Service through the AWS management Console , but It is taking too much time i.e. 1hr to Start and It keeps showing "CREATE IN PROGRESS status and nothing Is showing in cloudwatch logs , What could possibly be the Issue ?

  • No Error appears In CloudFormation Console , and it just showing "CREATE_IN_PROGRESS" status

Mahmoud
asked 3 months ago208 views
2 Answers
0

Hello.

When ECS is configured from the management console, a CloudFormation stack is created.
Therefore, I recommend checking the stack from the CloudFormation console to see if any errors occur.

profile picture
EXPERT
answered 3 months ago
  • I can't see any error , just "CREATE IN PROGRESS"

0

The issue you're experiencing with your ECS service creation being stuck in the CREATE_IN_PROGRESS status is likely due to the service not stabilizing, as mentioned in the article AWS Knowledge Center - CloudFormation ECS Service Stabilize. The article provides the following information:

A service created in Amazon ECS fails to stabilize if it isn't in the state specified by the AWS CloudFormation template. To confirm that a service launched the desired number of tasks with the desired task definition, AWS CloudFormation makes repeated DescribeService API calls. These calls check the status of the service until the desired state is met. The calling process can take up to three hours. Then, AWS CloudFormation times out, and returns the "Service ARN did not stabilize" message.

In your case, it seems that the ECS service is not reaching the desired state within the timeout period, causing the CloudFormation stack to remain in the CREATE_IN_PROGRESS status.

To investigate and potentially resolve this issue, you can follow the steps outlined in the "Resolution" section of the article:

  1. Verify resource creation: Ensure that the AWS::ECS::Service resource is correctly defined in your CloudFormation template, as shown in the example provided in the article.

  2. Update the desired count of the service: If the underlying issue with your ECS service tasks cannot be fixed immediately, you can try manually updating the desired count of the service to 0, as described in the article. This will force the CloudFormation stack to transition to the CREATE_COMPLETE or UPDATE_COMPLETE state.

    You can update the desired count using either the AWS CLI or the Amazon ECS console, as detailed in the article.

    # Using the AWS CLI
    aws ecs update-service --cluster awsExampleECSCluster --service MyNginxService2 --desired-count 0
    

    Important: Manually forcing the CloudFormation stack to a CREATE_COMPLETE state by stopping all tasks is not recommended for production services, as it can cause a temporary outage.

  3. Monitor the service and update the desired count: After updating the desired count to 0, the CloudFormation stack should transition to CREATE_COMPLETE or UPDATE_COMPLETE. You can then update the desired count back to your original value to resume normal operation.

If the issue persists or you don't see any related logs in CloudWatch, you may need to investigate further by checking the ECS service events, Tasks events and logs, and any other relevant AWS services to identify the root cause of the stabilization issue.

profile pictureAWS
EXPERT
answered 3 months ago

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