8

A task is running for a few seconds before terminating, I don't know why, and it's not pushing any logs.

Essential container in task exited

I'm using the "awslogs" driver and the log group exists in CloudWatch.

The "Logs" tab is empty. The log-stream is created in CW but it's devoid of actual log events. There are also no results under Insights for that stream.

The task role has the permissions mentioned at https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_cloudwatch_logs.html .

Any idea what the deal is with the logs?

Dustin Oprea
  • 9,673
  • 13
  • 65
  • 105

2 Answers2

0

The command wasn't valid nor was it comma-separated. It was terminating too early in the workflow to log anything, but yet after any other deployment issue would be identified. So, it was looking like it was successful but in reality wasn't yet even running. Interestingly, it would still take around a minute to terminate, so maybe this includes the overhead of pulling the image.

Dustin Oprea
  • 9,673
  • 13
  • 65
  • 105
0

Timestamps indicate that task started and exited after some seconds. awslogs will send logs if container has been successfully started, so, in this case it may not be helping. You can follow step 6 of documentation to diagnose. Specifically, if you have a container that has stopped, expand the container and inspect the Status reason row to see what caused the task state to change. In most cases, that will lead you to actual cause

SmartCoder
  • 856
  • 6
  • 11