- Newest
- Most votes
- Most comments
This issue occurs when an ECS task is stuck in the DEPROVISIONING state because it's trying to detach from a VPC Lattice target group that no longer exists.
To troubleshoot and resolve this issue:
- First, gather more information about the task using the describe-tasks AWS CLI command:
aws ecs describe-tasks --cluster claythis-ml-cluster-dev --tasks arn:aws:ecs:us-east-1:891515323026:task/claythis-ml-cluster-dev/c2e9b2064f41487c92e47d16736e0683
Check the output for specific error codes, reasons, and stop codes that might provide more insight into why the task is stuck.
-
Since the VPC Lattice target group has already been deleted, the task is unable to properly deregister from it, causing the "ECS encountered an internal error while managing the VPC Lattice Targets" error.
-
For immediate resolution, you can try to force-stop the task:
aws ecs stop-task --cluster claythis-ml-cluster-dev --task arn:aws:ecs:us-east-1:891515323026:task/claythis-ml-cluster-dev/c2e9b2064f41487c92e47d16736e0683 --reason "Force stopping stuck task"
-
If the task remains stuck, contact AWS Support as they may need to manually intervene to clean up the orphaned task.
-
For future reference, when using VPC Lattice with ECS, ensure that you properly deregister tasks from target groups before deleting the target groups themselves. Amazon ECS automatically registers and deregisters tasks to VPC Lattice target groups, but this process can be disrupted if the target group is deleted while tasks are still registered.
-
Check your cluster's capacity to ensure you have enough resources to run new tasks once this issue is resolved.
Sources
Troubleshoot target deregistration for Amazon ECS tasks | AWS re:Post
ECS task stuck in the PROVISIONING state | AWS re:Post
Use Amazon VPC Lattice to connect, observe, and secure your Amazon ECS services - Amazon Elastic Container Service
answered a year ago
Relevant content
asked a year ago
asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
