I am trying to run a Docker container on ECS, and my tasks keep restarting with STOPPED(Essential container in task exited) but I don't see logs under the container section.
This is the error I'm seeing:

In the documentation it mentions for this error I'm experiencing I can find the details under the Cotnainers tab. But in my case there are no details in that tab:

If I click on "View logs in CloudWatch" I see no logs:

I've read that if I can use EC2 instead of Fargate, then I could SSH into my instance and see the logs, but in my task definition I can't find where to choose something else than Fargate:

Where can I see my app logs?
Thanks.
Found the solution to this, logs are under CloudWatch -> Logs -> Insights.
Added the answer also to this SO question.
Hello Team,
I am also experiencing the same errors, with no logs and no help from the internet, Please help and share the steps you followed for debugging.
Hello team,
same issue i m also facing, i searched a lot in Google but i cannot able to sort out this issue, can anyone have any idea on this issue and please help me.
Thanks in Advance
@raghucheruku I solve the issue Successfully. Step to find the issue.
$ssh to ec2 instance
$docker ps -a
copy the exited container id
$docker logs
this will give you hint to solve further.
Hi All,
I am facing the same issue. How to resolve this for Fargate type. Cause i cannot SSH into instance if it is of type Fargate. Please help me out.
Thanks In advance
The solution that worked for me is here:
https://stackoverflow.com/questions/54131298/how-to-debug-failed-fargate-task-initialization
On Monday, April 27, 2020, nithinachary notifications@github.com wrote:
Hi All,
I am facing the same issue. How to resolve this for Fargate type. Cause i
cannot SSH into instance if it is of type Fargate. Please help me out.
Thanks In advance—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/aws/amazon-ecs-agent/issues/1883#issuecomment-619868804,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA6KR2KJLGNBHV4S6WHAWHDROVIU3ANCNFSM4GZZEEIQ
.
Daniel Wilches
Most helpful comment
@raghucheruku I solve the issue Successfully. Step to find the issue.
$ssh to ec2 instance
$docker ps -a
copy the exited container id
$docker logs
this will give you hint to solve further.