Search code examples
amazon-web-servicesdockeramazon-ecs

AWS ECS Task Exit code: 1


I try to execute an ECS task from a lambda function, the task is created successfully but when the execution starts shortly after the task stops and in Container details shows a message saying: Exit code: 1 .

When the message ends in the log list it says: exec /usr/local/bin/python3: exec format error. but I don't understand why, the local image works fine. I try to see if it is a policy or role issue but it doesn't seem to be the solution.

enter image description here

I don't think it's the image because if I run it locally it works, but I'm running out of possibilities.

I'm also trying to see now if it's an AWS permissions issue.


Solution

  • When the message ends in the log list it says: exec /usr/local/bin/python3: exec format error.

    This means you either deployed an X86 image to an ARM server (like AWS Fargate Graviton), or you deployed an ARM image (like an image built on an M1 Mac) to an X86 server.