aws resource_error ai_generated partial

服务无法放置任务:原因:此时容量不可用。

service unable to place tasks: reason: capacity is unavailable at this time.

ID: aws/ecs-task-stuck-pending-capacity

其他格式: JSON · Markdown 中文 · English
85%修复率
87%置信度
1证据数
2024-09-05首次发现

版本兼容性

版本状态引入弃用备注
ecs-2024-06 active
fargate-1.4.0 active
ecs-cli-2.0.0 active

根因分析

ECS 集群缺乏足够的 EC2 或 Fargate 容量来启动任务,通常由于可用区中的实例类型不可用。

English

ECS cluster lacks sufficient EC2 or Fargate capacity to launch the task, often due to instance type unavailability in the AZ.

generic

官方文档

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages.html

解决方案

  1. 更改任务放置策略以跨多个可用区分布:`aws ecs update-service --cluster my-cluster --service my-service --placement-strategy type=spread,field=attribute:ecs.availability-zone`
  2. 使用不同的实例类型或 Fargate 平台版本:更新任务定义以使用 `FARGATE` 或不同的 CPU/内存组合。

无效尝试

常见但无效的做法:

  1. 90% 失败

    Restarting the ECS service doesn't free capacity; the underlying resource shortage persists.

  2. 80% 失败

    Increasing task count makes the problem worse by requesting more unavailable capacity.