Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elastic Beanstalk with Docker deployment failure

I'm trying to deploy my application with docker and elastic beanstalk. My Dockerrun.aws.json file looks like

{
  "AWSEBDockerrunVersion": "1",
  "Image": {
    "Name": "jvans/maven_weekly",
    "Update": "true"
  },
  "Ports": [
    {
    "ContainerPort": "5000"
  }],
  "Volumes": [
    {
      "HostDirectory": "/Users/jamesvanneman/Code/maven_weekly/maven_weekly",
      "ContainerDirectory": "/maven_weekly"
  }
  ],
  "Logging": "/var/log/nginx"
}

I created this application with eb create and when I run eb deploy I get

Docker container quit unexpectedly after launch: Docker container quit 

unexpectedly on Mon Sep 21 01:15:12 UTC 2015:. Check snapshot logs for details. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/enact/00run.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

In var/log/eb-activity.log I see the following errors:

  Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Mon Sep 21 01:08:52 UTC 2015:. Check snapshot logs for details. (ElasticBeanstalk::ExternalInvocationError)
caused by: 83ea9b7f9a069eeb8351fef7aaedb8374f7dfe300a5e0aaeba0fe17600583175
[2015-09-21T01:08:52.205Z] INFO  [2246]  - [Application deployment/StartupStage1/AppDeployEnactHook/00run.sh] : Activity failed.

So it seems like there's a problem with a startup script. If i ssh into the container and try to run it manually I don't really get any extra help from error messages.

eb ssh

sudo /opt/elasticbeanstalk/hooks/appdeploy/enact/00run.sh

Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Mon Sep 21 01:34:52 UTC 2015:. Check snapshot logs for details.
Msg: Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Mon Sep 21 01:34:52 UTC 2015:. Check snapshot logs for details.

Are snapshot logs something different than what's in var/log/eb-activity.log? Any Idea what is going on/how I can debug this further?

like image 892
jvans Avatar asked Sep 21 '15 01:09

jvans


People also ask

Can Elastic Beanstalk deploy Docker?

Elastic Beanstalk deploys a Docker image and source code to EC2 instances on this platform branch. Use the Docker Compose tool on the Docker platform to simplify your application configuration, testing, and deployment.

How do you use Elastic Beanstalk with Docker?

Deploy to the Cloud Using the Elastic Beanstalk Console Choose “AWS Cloud9” and “Go To Your Dashboard.” Choose “Services” and “Elastic Beanstalk.” At the top right, choose “Create Application.” Paste flask-app for the “Application Name.” For “Platform,” choose “Docker.” Leave the Docker settings as is.

Is Elastic Beanstalk outdated?

On July 18, 2022 Elastic Beanstalk set the status of all platform branches based on Amazon Linux AMI (AL1) to retired. For more information, see AL1 platform retirement FAQ in the AWS Elastic Beanstalk Developer Guide.


2 Answers

Docker dumps are stored in the host box at /var/log/eb-docker/containers/.
Go there and you'll find the docker startup crash log that should indicate the root cause of your problem.

like image 170
Tal Avatar answered Oct 21 '22 10:10

Tal


You want to look at

/var/log/eb-docker/containers/eb-current-app/unexpected-quit.log

in the bundle downloaded by eb logs --all or using eb ssh. This log file will have the stdout and stderr of your application before it crashed.

like image 27
Radon Rosborough Avatar answered Oct 21 '22 10:10

Radon Rosborough