- Newest
- Most votes
- Most comments
When an ECS-optimized AMI instance becomes unreachable and the ECS agent disconnects before tasks can run, there are several potential causes to investigate. First, check the instance's system logs through the EC2 console by selecting your instance, then choosing Actions > Monitor and troubleshoot > Get system log. This can reveal kernel problems, service configuration issues, or boot failures that might explain why the instance becomes unreachable. You can also capture a screenshot of the instance to see its current state, which is particularly useful for diagnosing boot-related issues. Monitor the CPUUtilization metric in CloudWatch to verify whether the operating system is actually active and responsive. If the instance appears stuck during boot or becomes unresponsive, try rebooting it first. If rebooting doesn't resolve the issue, you may need to recover the instance by stopping and starting it, which can help if there's an underlying host issue. Regarding your resource configuration, with a task using 1000 CPU units and 350 MB memory reservation on t4g.nano instances (which have limited resources), you might be experiencing resource exhaustion. The t4g.nano has only 512 MB of memory, and after accounting for the operating system and ECS agent overhead, there may not be sufficient resources for your task. Even on t4g.micro instances with 1 GB of memory, if multiple tasks are scheduled or if there are memory spikes, the instance could become unresponsive. Consider using larger instance types with more headroom, or adjust your task's CPU and memory requirements. Also verify that your security groups, VPC configuration, and IAM instance profile are correctly configured to allow the ECS agent to communicate with the ECS service and for Systems Manager to function properly. If the issue persists across AMI versions, you might want to temporarily pin to a known working AMI version while investigating further.
Sources
Troubleshoot an unreachable Amazon EC2 instance - Amazon Elastic Compute Cloud
Common screenshots to troubleshoot unreachable Windows instances - Amazon Elastic Compute Cloud
Relevant content
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 8 months ago
