ebs-deploy icon indicating copy to clipboard operation
ebs-deploy copied to clipboard

Error during init of new application

Open josegonzalez opened this issue 11 years ago • 10 comments

I configured my ebs.config as it says in the readme, but I get the following consistent error:

Creating application haldane
Creating environment: Haldane-Prod, tier_name:WebServer, tier_type:Standard
Traceback (most recent call last):
  File ".virtualenv/bin/ebs-deploy", line 81, in <module>
    main()
  File ".virtualenv/bin/ebs-deploy", line 75, in main
    exit(command.execute(helper, config, args))
  File "/vagrant/.virtualenv/local/lib/python2.7/site-packages/ebs_deploy/commands/init_command.py", line 39, in execute
    version_label=args.version_label)
  File "/vagrant/.virtualenv/local/lib/python2.7/site-packages/ebs_deploy/__init__.py", line 293, in create_environment
    tier_version=tier_version)
  File "/vagrant/.virtualenv/local/lib/python2.7/site-packages/boto/beanstalk/layer1.py", line 357, in create_environment
    return self._get_response('CreateEnvironment', params)
  File "/vagrant/.virtualenv/local/lib/python2.7/site-packages/boto/beanstalk/layer1.py", line 71, in _get_response
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.BotoServerError: BotoServerError: 400 Bad Request
{"Error":{"Code":"InvalidParameterValue","Message":"No application version exists to deploy for Application named haldane.","Type":"Sender"},"RequestId":"53ccde20-5c7d-11e4-b343-4568be2697be"}

josegonzalez avatar Oct 25 '14 19:10 josegonzalez

I can confirm the same issue on init action. Here is my ebs.config file https://gist.github.com/yopeso/74f07ecc3e13c92e4fdc Please help fix the issue. Thanks.

yopeso-ci-bot avatar Dec 03 '14 16:12 yopeso-ci-bot

Seems the version must exist before we can create an environment. To do that, we need to have an application archive up, and it seems you need an env_config in order to call upload_application_archive. Seems this never actually worked? Maybe I'm missing something a step?

josegonzalez avatar Dec 16 '14 17:12 josegonzalez

Weird, we use this quite often at Flipagram. I'll take a look.... Can you post your config? On Dec 16, 2014 9:50 AM, "Jose Diaz-Gonzalez" [email protected] wrote:

Seems the version must exist before we can create an environment. To do that, we need to have an application archive up, and it seems you need an env_config in order to call upload_application_archive. Seems this never actually worked? Maybe I'm missing something a step?

— Reply to this email directly or view it on GitHub https://github.com/briandilley/ebs-deploy/issues/15#issuecomment-67200971 .

briandilley avatar Dec 19 '14 17:12 briandilley

My ebs.config:

# aws account config
aws:
    # A key that supports all the things needed for elasticbeanstalk
    access_key: 'SOME-KEY'
    secret_key: 'SOME-SECRET-KEY'
    region: 'us-east-1'
    bucket: 'ebs-archives'
    bucket_path: 'haldane'

app:
    versions_to_keep: 10
    app_name: 'haldane'
    description: 'haldane'

    all_environments:
        solution_stack_name: '64bit Amazon Linux 2014.03 v1.0.91 running Python 2.7'

        tier_name: 'WebServer'
        tier_type: 'Standard'
        tier_version: '1.0'

        option_settings:

            'aws:autoscaling:launchconfiguration':
                Ec2KeyName: 'seatgeek-asg'
                InstanceType: 't2.micro'
                SecurityGroups: 'mycompany-web'

            'aws:elasticbeanstalk:environment':
                EnvironmentType: 'SingleInstance'
            'aws:autoscaling:updatepolicy:rollingupdate':
                RollingUpdateEnabled: false

            'aws:elasticbeanstalk:container:python':
                WSGIPath: 'application.py'
                NumProcesses: 1
                NumThreads: 15

            'aws:autoscaling:asg':
                MinSize: 1
                MaxSize: 1

            'aws:elb:policies':
                Stickiness Policy: true

            'aws:elasticbeanstalk:application':
                Application Healthcheck URL: '/_status'

            'aws:elasticbeanstalk:application:environment':
                AWS_ACCESS_KEY_ID: '${MY_AWS_ACCESS_KEY_ID}'
                AWS_SECRET_KEY: '${MY_AWS_SECRET_KEY}'


        archive:
            includes: # files to include, a list of regex
            excludes: # files to exclude, a list of regex
                - '^.gitignore$'
                - '^\.git*'
                - '.*\.egg-info$'
                - '^tests.*'
                - '.*\.zip$'
                - '^venv.*'

    environments:
        'sg-haldane-prod':
            cname_prefix: 'sg-haldane-prod'
            option_settings:
                'aws:elasticbeanstalk:application:environment':
                    AWS_ACCESS_KEY_ID: 'SOME-KEY'
                    AWS_REGIONS: 'us-east-1,us-west-1'
                    AWS_SECRET_ACCESS_KEY: 'SOME-SECRET-KEY'
                    CACHE_EXPIRATION: 180
                    CACHE_SIZE: 1024
                    DEBUG: false
                    LISTEN_INTERFACE: '0.0.0.0'
                    PORT: 5000
                    SUPPRESS_SENTRY: true

josegonzalez avatar Dec 19 '14 19:12 josegonzalez

Any luck figuring out what I may have done wrong?

josegonzalez avatar Jan 02 '15 21:01 josegonzalez

If it helps, I can share the app I'm attempting to deploy :)

josegonzalez avatar Jan 02 '15 21:01 josegonzalez

What command are you running On Jan 2, 2015 1:12 PM, "Jose Diaz-Gonzalez" [email protected] wrote:

If it helps, I can share the app I'm attempting to deploy :)

— Reply to this email directly or view it on GitHub https://github.com/briandilley/ebs-deploy/issues/15#issuecomment-68562736 .

briandilley avatar Jan 02 '15 21:01 briandilley

ebs-deploy init is the command I run.

josegonzalez avatar Jan 02 '15 21:01 josegonzalez

+1 encountered the same problem, boto seems to do this: here https://github.com/briandilley/ebs-deploy/blob/master/ebs_deploy/init.py#L313

VersionLabel (string) --
The name of the application version to deploy.

If the specified application has no associated application versions, AWS Elastic Beanstalk UpdateEnvironment returns an InvalidParameterValue error.

Default: If not specified, AWS Elastic Beanstalk attempts to launch the sample application in the container.

from http://boto3.readthedocs.org/en/latest/reference/services/elasticbeanstalk.html#ElasticBeanstalk.Client.create_environment

ixaxaar avatar Jan 05 '16 11:01 ixaxaar

In the config file provided by @josegonzalez, the Solution Stack name provided has v1.0.91, which isn't a provided Solution Stack by EB. This error will come up when providing a Solution Stack name that EB doesn't know about.

Check your provided Solution Stack name; if correct, it should default to deploying the sample app (as @ixaxaar mentioned) if there is no provided application version.

ballpointcarrot avatar Apr 16 '16 17:04 ballpointcarrot