Dieser Inhalt ist in der ausgewählten Sprache nicht verfügbar
Wir arbeiten ständig daran, Inhalte in der ausgewählten Sprache bereitzustellen. Vielen Dank für deine Geduld.
How do I resolve the error "the closest matching container-instance container-instance-id encountered error 'AGENT'" for my service in Amazon ECS?
Lesedauer: 2 Minute
0
When I try to place a task in Amazon Elastic Container Service (Amazon ECS), I receive the following error: "[AWS service] was unable to place a task because no container instance met all of its requirements. The closest matching container-instance container-instance-id encountered error 'AGENT'."
Resolution
This error occurs when the Amazon ECS container agent that runs on the container instance that's designated for task placement is disconnected.
To resolve this error, check your agent logs and verify that the agent is running on the instance. Then, restart the agent.
Check your agent logs
Complete the following steps:
Use SSH to connect to the container instance.
Check your agent logs at /var/log/ecs/ecs-agent.log.YYYY-MM-DD-HH. Note: Replace the example timestamp with the timestamp for your logs.
Temporarily activate DEBUG logs for ECS Agent with the ECS_LOGLEVEL flag in the /etc/ecs/ecs.config file.
Run the appropriate command to restart the agent.
If the issue isn't resolved after your restart the agent, then use the debug logs to troubleshoot the issue.
For an Amazon ECS optimized Amazon Machine Image (AMI), stop and restart the agent with the appropriate command.
For Amazon ECS optimized Amazon Linux 2 AMIs, run the following command:
sudo systemctl restart ecs
For Amazon ECS optimized Amazon Linux AMIs, run the following command: