Question

Essential container in task exited

I am trying to configure my docker hub image with aws ecs..I have created repository, cluster, and task while running task am getting an error as an essential container in task exited 1. while trying to get exact error details I have found that some of my variables are shown as not configured.

find the screenshot attached of errors.

cluster details error detail

 48  97888  48
1 Jan 1970

Solution

 37

You should setup the "Log Configuration" by specifying a log configuration in your task definition. I would recommend the awslogs configuration type, as this lets you see the logs from your container right inside the console.

Once you do that you will get a new tab on the task details screen called "Logs" and you can click that to see the output from your container as it was starting up. You will probably see some kind of error or crash as the "Essential container exited" error means that the container was expected to stay up and running, but it just exited.

2019-04-16

Solution

 4

I had to expand the corresponding container details in the stopped task and check the "Details" --> "Status reason", which revealed the following issue:

OutOfMemoryError: Container killed due to memory usage Exit Code 137

After increasing the available container memory, it worked fine.

2022-03-23