Closed JPBou closed 2 weeks ago
I'm having the exact same issue.
Thanks for reaching out. The ECS run_task command involves the underlying RunTask API, so the issue here relates to the ECS service rather than Boto3 directly. I found this other issue referencing the same error message: https://github.com/boto/boto3/issues/2862. The creator of that issue closed it and noted that "passing launchType overrides the capacity provider settings, thus ignoring the autoscaler." So it seems like omitting launchType
is required here, but that isn't fully clear in the documentation or error message.
I will reach out to the ECS team for clarification, and created https://github.com/aws/aws-sdk/issues/761 to track this in our cross-SDK repository going forward. So please refer to that issue for updates. And for documentation feedback in the future you can also use the Provide feedback at the bottom of the API documentation page to send feedback directly, and any updates to those docs would automatically get reflected in the Boto3 docs.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Describe the bug
I have a task definition that runs on ECS and uses EC2 as its launch type.
When calling this, the task is submitted successfully to the cluster, even if there are no running instances (I have my ASG taking care of that):
Response:
But if I submit my task passing launch type as a parameter, the call will error out when there are no instances running on the cluster:
Error log:
Expected Behavior
The API call should for run task should work when submitting a task to a cluster with no instances when I pass in launch type as a parameter.
Current Behavior
The run task API does not work when submitting launch type as a parameter if the cluster has no running instances.
Reproduction Steps
ecs_client = boto3.client('ecs') def_dict = { "cluster":"ecs-gpu-cluster", "launchType":"EC2", "taskDefinition":"arn:aws:ecs:us-east-2:058442094236:task-definition/prefect_ecs-gpu-pool_47cd3a8c-d732-4670-83e5-1d12e2f43d6d:8", } ecs_client.run_task(**def_dict)
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.34.122
Environment details (OS name and version, etc.)
Linux