CannotStartContainerError aws resource_error ai_generated true

已停止(CannotStartContainerError:API 错误 (500):devmapper:精简池有 X 个空闲数据块,少于所需的最小 X 个总数据块)

STOPPED (CannotStartContainerError: API error (500): devmapper: Thin pool has X free data blocks which is less than the minimum required X total data blocks)

ID: aws/ecs-task-stopped-cannotstartcontainererror

其他格式: JSON · Markdown 中文 · English
75%修复率
85%置信度
1证据数
2023-08-15首次发现

版本兼容性

版本状态引入弃用备注
ECS 1.62.0 active
Docker 20.10.17 active
Amazon Linux 2 active

根因分析

ECS 任务失败,因为容器实例上的 Docker 存储驱动程序(devicemapper)的精简池中的空闲数据块不足,通常是由于磁盘空间耗尽或 Docker 存储配置错误。

English

ECS task fails because the Docker storage driver (devicemapper) on the container instance has insufficient free data blocks in its thin pool, often due to disk space exhaustion or misconfigured Docker storage.

generic

官方文档

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-stopped-reason-cannotstartcontainererror.html

解决方案

  1. Run `docker system prune -a --volumes` on the container instance to remove unused Docker objects and free thin pool space. Then restart the ECS task.
  2. Increase the Docker base device size by editing `/etc/docker/daemon.json` to set `{"storage-opts": ["dm.basesize=50G"]}` and restarting Docker service.

无效尝试

常见但无效的做法:

  1. Manually restarting the ECS agent or the container instance without cleaning up unused images/containers. 90% 失败

    The underlying thin pool is still full; restarting does not free data blocks.

  2. Increasing the ECS task memory limit without addressing Docker storage. 95% 失败

    The error is about disk storage blocks, not memory allocation.