aws-cdk-examples icon indicating copy to clipboard operation
aws-cdk-examples copied to clipboard

(ecs): ecs-service-with-advanced-alb-config example does not work

Open anggras opened this issue 3 years ago • 4 comments
trafficstars

What is the problem?

Upon cdk deploy, the ECS service stuck and unable to proceed with message:

service XXXXX was unable to place a task because no container instance met all of its requirements. Reason: No Container Instances were found in your cluster. For more information, see the Troubleshooting section.

Reproduction Steps

  1. Clone the ecs-service-with-advanced-alb-config example
  2. Install the requirements
  3. Run cdk deploy

What did you expect to happen?

The sample ECS service should be deployed successfully

What actually happened?

The deployment is stuck and unable to complete. The ECS service event console shows the following message:

service XXXXX was unable to place a task because no container instance met all of its requirements. Reason: No Container Instances were found in your cluster. For more information, see the Troubleshooting section.

CDK CLI Version

2.3.0 (build beaa5b2)

Framework Version

No response

Node.js Version

16.13.1

OS

macOS

Language

Python

Language Version

No response

Other information

No response

anggras avatar Dec 29 '21 03:12 anggras

There's another issue with the example... it's attempting to use instance type m5.micro (https://github.com/aws-samples/aws-cdk-examples/blob/752df6302e534a7df22a809536c588deaf444c4d/python/ecs/ecs-service-with-advanced-alb-config/app.py#L26) when there isn't an instance size 'micro' for family m5: https://aws.amazon.com/ec2/instance-types/m5/

its-mirus-lu avatar Mar 10 '22 21:03 its-mirus-lu

This error is also coming up... it may have to do with how the name of the resource is interpolated as a concatenation of the stack and resource name: The specified capacity provider name is invalid. Up to 255 characters are allowed, including letters (upper and lowercase), numbers, underscores, and hyphens. The name cannot be prefixed with "aws", "ecs", or "fargate". Specify a valid name and try again.

its-mirus-lu avatar Mar 10 '22 22:03 its-mirus-lu

With respect to @anggras' original error, I was not able to reproduce the error message: "service XXXXX was unable to place a task because no container instance met all of its requirements. Reason: No Container Instances were found in your cluster. For more information, see the Troubleshooting section."

However, I did discover that an incorrect instance type was specified for the autoscaling group definition (m5.micro doesn't exist). The stack wouldn't synth because the ecs autoscaling group name did not meet the name requirements. I'll create a new issue since these issues don't directly address OP's issue.

its-mirus-lu avatar Mar 10 '22 22:03 its-mirus-lu

The fix for this is in PR #626

its-mirus-lu avatar Mar 25 '22 05:03 its-mirus-lu

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Dec 28 '24 23:12 github-actions[bot]