Search code examples
amazon-web-servicesamazon-ec2amazon-ecs

Where do I go to see what my ECS tasks are actually doing when they enter "pending" state?


My biggest frustration with ECS is that it's not observable.

I deploy my service, my tasks go into "pending" and I cross my fingers.

Sometimes I get useful error messages in the console, sometimes they just hang in "pending" indefinitely. I see no events being generated and have no idea what it's trying to do, or where it is stuck.

I can restart the ECS service or other hacks I've had to do before, but at this point I'd like to see what's actually happening when a task is in "pending". Are there logs anywhere for this?


Solution

    1. Click on that task which is in pending state. It will show you the single log status of the container and If you have attached the cloud watch logs It will show you the full logs about why it is pending?.

    2. Check the docker container logs by SSHing to the ec2 container instance of the task you are running.