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
Essential container in task exited If the essential parameter of a container is marked as true and that container fails or stops for any reason, then all other containers that are part of that task are stopped.
You can receive this error due to one or more of the following reasons: No container instances were found in your cluster. The port needed by the task is already in use. Not enough memory for your tasks.
Open the Amazon ECS console at https://console.aws.amazon.com/ecs/ . On the Clusters page, select the cluster where your stopped task resides. On the Cluster : clustername page, choose Tasks. In the Desired task status table header, choose Stopped, and then select the stopped task to inspect.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With