17

In ECS Fargate, when a task fails, there is a "Stopped Reason" field which gives some useful logging. However I have noticed that it gets truncated after 255 symbols (screenshot below).

I checked the network tab and tracked the JSON of the http response, and it is truncated even there (so server-side). Is there any way to get the complete message?

I find this thread where they discuss the same problem.

How can I see the whole, untruncated error message?

enter image description here

sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • Did you try AWS CLI: `aws ecs describe-tasks --cluster --tasks `? – Tasos P. Apr 21 '21 at 08:57
  • What do you want to do? How do you use ssm in your ECS? – Marcin Apr 21 '21 at 09:48
  • Thank you, I edited my question and added what I want to do. – sashoalm Apr 21 '21 at 09:57
  • 1
    @sashoalm Did you check if the field is also truncated in AWS ECS events? see: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html#ecs_task_events --> "The underlying container instance is stopped or terminated." Technically it says "The detail section below resembles the ContainerInstance object that is returned from a DescribeContainerInstances API operation" but I didn't check this out though. – Martin Löper Apr 25 '21 at 01:36
  • 2
    Thank you all. I found the whole error message in CloudTrail eventually. I searched by "Username", and entered the Task GUID as username. This narrowed down the amount of events I had to sift through. The full error message was in an "GetParameters" event. – sashoalm Apr 26 '21 at 19:52

1 Answers1

15

I found the whole error message in CloudTrail eventually. I searched by "Username", and entered the Task GUID as username. This narrowed down the amount of events I had to sift through. The full error message was in a "GetParameters" event.

Just FYI for anyone who reads this answer the task GUID is the ID at the end of the taskArn or if you go to Task in the console it will be the ID that you see in Task : fc0398a94d8b4d4d9218a6d870914a80 – Emmanuel N K Jun 21 at 13:21

sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • 4
    Just FYI for anyone who reads this answer the task GUID is the ID at the end of the `taskArn` or if you go to Task in the console it will be the ID that you see in `Task : fc0398a94d8b4d4d9218a6d870914a80` – Emmanuel N K Jun 21 '21 at 13:21
  • 1
    Wow I would NEVER have tried that, thanks a lot, found what I needed!! – Alexandre Couret Oct 21 '21 at 13:09
  • 1
    In my case, I got this error: `CannotPullContainerError: inspect image has been retried 5 time(s): httpReaderSeeker: failed open: unexpected status code https://registry-1.docker.io/v2//manifests/sha256:5c72e0e669ae6fe69faf6386543925ff1a6ce3af2eedacdd9...` Doing the above way just give me a `GetAuthorizationToken` event with the task ID as `User name`, with no useful information. – sonlexqt Nov 07 '21 at 09:05