I receive errors when I try to set up a new capacity provider or update an existing capacity provider for my Amazon Elastic Container Service (Amazon ECS) cluster.
Resolution
You might receive errors when you set up a new capacity provider or update an existing capacity provider for your Amazon ECS cluster. Choose the troubleshooting steps that match your error:
Resolve errors when you create a capacity provider with the AWS CLI
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.
When you use the AWS CLI to create a capacity provider, review your AWS CloudTrail events to check for the CreateCapacityProvider API. You might receive the following CapacityProvider API errors:
- ClientException: A client action uses an action or resource on behalf of an AWS Identity and Access Management (IAM) user without the required permissions. This error also occurs when an identifier isn't valid.
- UpdateInProgressException: An ECS container agent update is already in progress on the container instance that you specified. If the container agent disconnects in a transitional stage, such as PENDING or STAGING, then the update stays in that state. When the agent reconnects, the update resumes where it stopped.
For more information, see Errors.
You receive the error: "The specified capacity provider already exists. To change the configuration of an existing capacity provider, update the capacity provider"
To resolve this error, use a unique name for the capacity provider. Or, delete the existing capacity provider and then create a new one.
To view all capacity providers, run the following describe-capacity-providers AWS CLI command:
aws ecs describe-capacity-providers --query capacityProviders\[\].name --region example-region
Note: Replace example-region with your AWS Region.
The output looks similar to the following:
[
"FARGATE",
"FARGATE_SPOT",
"ecs-capacityprovider-1"
]
To delete a capacity provider, run the delete-capacity-provider AWS CLI command:
aws ecs delete-capacity-provider --capacity-provider ecs-capacityprovider-1 --region example-region
Note: Replace example-region with your AWS Region and ecs-capacityprovider-1 with your capacity provider name.
To create a new capacity provider, run the create-capacity-provider AWS CLI command:
aws ecs create-capacity-provider --name "example-capacity=provider" --auto-scaling-group-provider "autoScalingGroupArn=arn:aws:autoscaling:us-east-1:123456789012:autoScalingGroup:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:autoScalingGroupName/MyAutoScalingGroup,managedScaling={status=ENABLED,targetCapacity=100,minimumScalingStepSize=1,maximumScalingStepSize=100},managedTerminationProtection=ENABLED"
Note: Replace example-capacity with your capacity provider name.
You receive the error: "The specified Auto Scaling group ARN is already being used by another capacity provider. Specify a unique Auto Scaling group ARN and try again"
The Auto Scaling group and capacity provider must have a one-to-one relationship. Confirm that your capacity provider is associated with only one Auto Scaling group, and that the group is associated with only one capacity provider.
You create the capacity provider strategy and receive the error: "The specified cluster is in a busy state. Cluster attachments must be in UPDATE_COMPLETE or UPDATE_FAILED state before they can be updated. Wait and try again"
This error resolves automatically after a few minutes. After the error resolves, update the capacity provider again. Or, run the describe-clusters AWS CLI command to view the current status of the attachments. Then, wait until the attachment is in the UPDATE_COMPLETE status:
aws ecs describe-clusters --clusters example-ARN --include ATTACHMENTS --query clusters\[\].attachmentsStatus --region example-region
Note: Replace example-ARN with your ARN and example-region with your AWS Region.
A completed update status output looks similar to the following:
[
"UPDATE_COMPLETE"
]
You receive errors because of limitations with the capacity provider
Confirm that your capacity provider meets the following requirements:
- You can't specify more than six capacity providers for a capacity strategy.
- Use either AWS Auto Scaling group capacity providers or AWS Fargate capacity providers in your cluster strategy. You can't use a combination of both types.
- The base value for the capacity provider strategy is supported only when you run the tasks.
The capacity provider is created successfully with CloudFormation, but it isn't shown in the console
This error occurs when you don't associate the capacity provider with the cluster in your AWS CloudFormation template. To resolve this issue, add the following configuration to your CloudFormation template:
..
ECSCluster:
Type: 'AWS::ECS::Cluster'
Properties:
ClusterName: example-cluster
CapacityProviders:
- !Ref ECSCapacityProvider
..
Resolve a capacity provider stuck in UPDATE_IN_PROGRESS
In rare cases, the capacity provider status doesn't update from UPDATE_IN_PROGRESS. This prevents deletion or further updates. To resolve this issue, contact AWS Support.
Related information
Amazon ECS capacity providers for EC2 workloads
How do I resolve errors when I delete a capacity provider in Amazon ECS?