title: AWS Elastic Beanstalk, create environment failed
body: <p>I am using EB for the first time, attempting to upload a Ruby on Rails application from Github to AWS. I am following the step-by-step guide, but I continue running into an error:</p>
  
  <pre><code>$ eb create betz5-env
  Creating application version archive "app-7f74-160822_083029".
  Uploading betz/app-7f74-160822_083029.zip to S3. This may take a while.
  Upload Complete.
  Environment details for: betz5-env
  Application name: betz
  Region: us-east-1
  Deployed Version: app-7f74-160822_083029
  Environment ID: e-3zyk4pueyq
  Platform: 64bit Amazon Linux 2016.03 v2.1.3 running Ruby 2.1 (Puma)
  Tier: WebServer-Standard
  CNAME: UNKNOWN
  Updated: 2016-08-22 12:29:03.932000+00:00
  Printing Status:
  INFO: createEnvironment is starting.
  INFO: Using elasticbeanstalk-us-east-1-167880342437 as Amazon S3 storage bucket for environment data.
  INFO: Created security group named: sg-9e6fc9e4
  INFO: Created load balancer named: awseb-e-3-AWSEBLoa-6TCKNDPQOZUO
  INFO: Environment health has transitioned to Pending. Initialization in progress (running for 32 seconds). There are no instances.
  INFO: Created security group named: awseb-e-3zyk4pueyq-stack-AWSEBSecurityGroup-1VXHTSO3R625H
  INFO: Created Auto Scaling launch configuration named: awseb-e-3zyk4pueyq-stack-AWSEBAutoScalingLaunchConfiguration-CI7ZCOZGHSI
  INFO: Added instance [i-03e33a1f265f89c11] to your environment.
  INFO: Created Auto Scaling group named: awseb-e-3zyk4pueyq-stack-AWSEBAutoScalingGroup-1CN3N9XS45D1M
  INFO: Waiting for EC2 instances to launch. This may take a few minutes.
  INFO: Created Auto Scaling group policy named: arn:aws:autoscaling:us-east-1:167880342437:scalingPolicy:67c04326-a636-4870-ad45-b90a1b436646:autoScalingGroupName/awseb-e-3zyk4pueyq-stack-AWSEBAutoScalingGroup-1CN3N9XS45D1M:policyName/awseb-e-3zyk4pueyq-stack-AWSEBAutoScalingScaleUpPolicy-TKX4L47COQH7
  INFO: Created Auto Scaling group policy named: arn:aws:autoscaling:us-east-1:167880342437:scalingPolicy:87478c0b-452a-46ab-a23a-4434d4138a10:autoScalingGroupName/awseb-e-3zyk4pueyq-stack-AWSEBAutoScalingGroup-1CN3N9XS45D1M:policyName/awseb-e-3zyk4pueyq-stack-AWSEBAutoScalingScaleDownPolicy-1UGEJG8FXVJPC
  INFO: Created CloudWatch alarm named: awseb-e-3zyk4pueyq-stack-AWSEBCloudwatchAlarmLow-BA27Q69FXPNG
  INFO: Created CloudWatch alarm named: awseb-e-3zyk4pueyq-stack-AWSEBCloudwatchAlarmHigh-13NTHLWPMZE13
  ERROR: [Instance: i-03e33a1f265f89c11] Command failed on instance. Return code: 1 Output: (TRUNCATED)... denied for user 'root'@'ec2-54-204-93-56.compute-1.amazonaws.com' (using password: YES)
  /opt/rubies/ruby-2.1.9/bin/bundle:23:in `load'
  /opt/rubies/ruby-2.1.9/bin/bundle:23:in `&lt;main&gt;'
  Tasks: TOP =&gt; db:migrate
  (See full trace by running task with --trace). 
  Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/12_db_migration.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
  INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
  ERROR: Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
  WARN: Environment health has transitioned from Pending to Degraded. Command failed on all instances. Initialization completed 39 seconds ago and took 6 minutes.
  
  ERROR: The operation timed out. The state of the environment is unknown. The timeout can be set using the --timeout option.
  </code></pre>
  
  <p>I realize that I am leaving this quite open-ended, but I have no idea why this is not working or what my next step should be to resolve it.  The AWS trouble-shooting docs do not seem to be on point, from what I have been able to find.  Thanks for any help. </p>
  
  <p>Here is the eb-activity log: <a href="https://github.com/newom/betz/issues/1" rel="nofollow">https://github.com/newom/betz/issues/1</a></p>