2

I'm trying to create a new Elastic Beanstalk environment with the EB CLI but it keeps failing even though I've created an identical environment with the console which succeeds exactly as expected.

The command I'm running:

$ eb create my-new-environment --verbose --timeout 15 --single --process

The error I'm getting:

Stack named 'awseb-e-vpxgijpjkq-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBInstanceLaunchWaitCondition].

Here's my config file:

# .ebextensions/settings.config

option_settings:
    aws:elasticbeanstalk:managedactions:
        ManagedActionsEnabled: true
        PreferredStartTime: "Thu:04:00"
    aws:elasticbeanstalk:managedactions:platformupdate:
        UpdateLevel: minor
        InstanceRefreshEnabled: true
    aws:elasticbeanstalk:command:
        DeploymentPolicy: AllAtOnce
    aws:elasticbeanstalk:environment:
        EnvironmentType: SingleInstance
    aws:ec2:instances:
        InstanceTypes: t3.medium
    aws:elasticbeanstalk:cloudwatch:logs:
        StreamLogs: true
        DeleteOnTerminate: true
        RetentionInDays: 1
    aws:elasticbeanstalk:application:
        Application Healthcheck URL: /health
    aws:autoscaling:launchconfiguration:
        MonitoringInterval: 1 minute
    aws:autoscaling:updatepolicy:rollingupdate:
        RollingUpdateType: Immutable
    aws:elasticbeanstalk:application:environment:
        PORT: 3000

Here's my .elasticbeanstalk/config.yml:

# .elasticbeanstalk/config.yml

deploy:
  artifact: out.zip
global:
  application_name: my-application
  branch: null
  default_ec2_keyname: null
  default_platform: 64bit Amazon Linux 2 v2.0.2 running .NET Core
  default_region: eu-west-1
  include_git_submodules: true
  instance_profile: null
  platform_name: null
  platform_version: null
  profile: null
  repository: null
  sc: git
  workspace_type: Application

The only other results I've found for AWSEBInstanceLaunchWaitCondition mention that the VPC may have not been set up correctly, but this is for a single instance environment without a VPC so I don't know where to even begin to solve this. Or could this just be a bug in AWS or the EB CLI?

Aron
  • 8,696
  • 6
  • 33
  • 59
  • Can you go to CloudFormation console, and check EB stack events. Maybe there are more details there. Also EB always launches in a VPC. If you did not provide one, a default VPC is used. So maybe you modified it somehow? – Marcin Sep 28 '20 at 22:52
  • It says `WaitCondition timed out. Received 0 conditions when expecting 1`. Other than the cli command, `.ebextensions/settings.config` and `.elasticbeanstalk/config.yml` I haven't done or modified anything. I just try to run the command and it fails. – Aron Sep 28 '20 at 22:58
  • Seems like internet issue. Your EB instance fails to contact CloudFormation with the fail or success signal. When you are trying to create your EB env, can you go to EC2 console, and check how the EB instance is created? Which subnet, which vpc? Then you can inspect the VPC to check if it has internet connectivity. – Marcin Sep 28 '20 at 23:01
  • I've found the VPC and subnet but I'm not sure how to check whether it has internet connectivity :( sorry I'm a novice. Assuming it doesn't what can I do to ensure the VPC does get internet access when setting up the EB environment? – Aron Sep 29 '20 at 09:47
  • The basic check would be to take note of the subnet, and using EB console launch console in the same subnet. If EB succeeds, then you know there are no issues with the subnet and its internet connectivity. You can also inspect route tables of the subnet and check if they go internet gateway (igw). – Marcin Sep 29 '20 at 10:01
  • Yup it looks like both a console-created environment and a CLI created one have the same internet gateway ID :/ – Aron Oct 01 '20 at 21:32

1 Answers1

0

I also encountered the same error while publishing on AWS Beanstalk from Visual Studio.

Thanks for the answers above, I got clue that some error with CloudFormation. I logged in AWS with root acc. Go to CloudFormation. There I found the stack with the creation error. I clicked on this and found Retry button. After clicking Retry, it shows update initiated by user and status shows UPDATE_PENDING. A few minutes later It changes to UPDATE_COMPLETE. Then I check my beanstalk website and it works.

It seems just timeout error for me.

starball
  • 20,030
  • 7
  • 43
  • 238
Fred
  • 1