-1

Im running Node app through Docker on my EC2 instance. it's stuck with below logs and I couldn't figure out why it doesnt run my Docker image.

      docker0: port 1(veth3e0f04e) entered disabled state

This is the AMI name: amzn2-ami-ecs-hvm-2.0.20221230-x86_64-ebs

What might be missing in my setup based on this log?

Does it mean that docker has started?

Am I not able to see docker logs?

Edit: On my inital post error was due to reading issue from S3 bucket. After I fixed that I kept getting the error which is described in the title and shown on screenshot.

enter image description here

damdafayton
  • 1,600
  • 2
  • 10
  • 19
  • 2
    The `login:` is what a Linux usually shows when it has finished booting up and expects you to log in with a user name and password. Not sure why you expect Docker to start; it is not part of the default Amazon Linux AMI. Can you please add more details about your AMI and the userdata configuration? – lxg Jan 08 '23 at 15:16
  • I was able to make ec2 run the docker image but it keeps on crashing now. I have uploaded the docker image through ECR. So I just put the image URI into the task definition and run it. – damdafayton Jan 08 '23 at 16:06

1 Answers1

0

I was able to spot the exact problem and solve it, thanks to various SO posts.

For those who might have a problem at the early stages of their EC2 deployment, here is step-by-step how I tracked the problem and solved it:

  1. Instead of EC2 screenshots or logs I started searching about the error which was given for the Task Definition. You can find it under ECS > Clusters > Tasks > Stopped > Last Status. My error was: Essential container in task exited

  2. Which led me to this post which explains how to get logs from Docker.

  3. Then from the same Stopped tab, I clicked on Task Id > Logs and spotted an error like this: exec format error

  4. Which led me to this post and it finally solved my problem.

  5. So it turned out that the error was caused because the Docker build on Mac M1 was not suitable with AWS Linux.

damdafayton
  • 1,600
  • 2
  • 10
  • 19