ingenieux / beanstalker

Beanstalker helps you deploy into AWS Elastic Beanstalk from Maven

Home Page:http://docs.ingenieux.com.br/project/beanstalker/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PutEnvironment: Environment demo-web already exists

cemo opened this issue · comments

Hi,

I am having an issue when I call put-environment. Is this a bug?


[INFO] --- beanstalk-maven-plugin:1.5.0:put-environment (deploy) @ demo-web ---
[INFO] ... with cname belonging to demo-web.elasticbeanstalk.com or demo-web.us-east-1.elasticbeanstalk.com
[INFO] ... with status *NOT* set to 'Terminated'
[INFO] Looking up for solution stacks matching '64bit Amazon Linux 201* v* running Docker *'
[WARNING] FAILURE
org.apache.maven.plugin.MojoFailureException: Failed
    at br.com.ingenieux.mojo.aws.AbstractAWSMojo.handleException(AbstractAWSMojo.java:410)
    at br.com.ingenieux.mojo.beanstalk.cmd.BaseCommand.handleException(BaseCommand.java:86)
    at br.com.ingenieux.mojo.beanstalk.cmd.BaseCommand.execute(BaseCommand.java:78)
    at br.com.ingenieux.mojo.beanstalk.env.CreateEnvironmentMojo.createEnvironment(CreateEnvironmentMojo.java:374)
    at br.com.ingenieux.mojo.beanstalk.env.CreateEnvironmentMojo.executeInternal(CreateEnvironmentMojo.java:337)
    at br.com.ingenieux.mojo.beanstalk.env.PutEnvironmentMojo.executeInternal(PutEnvironmentMojo.java:63)
    at br.com.ingenieux.mojo.aws.AbstractAWSMojo.execute(AbstractAWSMojo.java:375)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:50)
Caused by: com.amazonaws.AmazonServiceException: Environment demo-web already exists. (Service: AWSElasticBeanstalk; Status Code: 400; Error Code: InvalidParameterValue; Request ID: 3686894b-0e5e-12e6-b2f6-5f6ece1fae64)

Environment Names are globally unique among AWS EB Users. So pick up another name and thats just fine.

(There's also check-availability for this FWIW)

Just in case: Changing beanstalk.cnamePrefix and beanstalk.environmentRef to match is all you need to rename it

Sorry for not being clear enough.

I want to create if not exist. If it exists, simply skip it. Is this goal provides this functionality?

it doea, as long as the name isnt being uaed by another aws account atm
On Apr 30, 2016 1:54 AM, "Cemalettin Koc" notifications@github.com wrote:

Sorry for not being clear enough.

I want to create if not exist. If it exists, simply skip it. Is this goal
provides this functionality?


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#99 (comment)

In my usecase I have configured my project as this:

                        <executions>
                            <execution>
                                <id>deploy</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>upload-source-bundle</goal>
                                    <goal>create-application-version</goal>
                                    <goal>put-environment</goal>
                                </goals>
                            </execution>
                        </executions>

However it works for only first build. The second one raising this error. Is this expected?

What are the values for cnamePrefix and environmentRef?

On Saturday, 30 April 2016, Cemalettin Koc notifications@github.com wrote:

In my usecase I have configured my project as this:

                    <executions>
                        <execution>
                            <id>deploy</id>
                            <phase>install</phase>
                            <goals>
                                <goal>upload-source-bundle</goal>
                                <goal>create-application-version</goal>
                                <goal>put-environment</goal>
                            </goals>
                        </execution>
                    </executions>

However it works for only first build. The second one raising this error.
Is this expected?


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#99 (comment)

-- Aldrin Leal, aldrin@leal.eng.br / http://about.me/aldrinleal

<environmentName>stage-${project.artifactId}</environmentName>
 <cnamePrefix>${environmentName}</cnamePrefix>

environmentRef is not set. It has default value.

Set environmentRef to ${cnamePrefix}.elasticbeanstalk.com

Also, try the archetypes and run with mvn -X for comparison

On Saturday, 30 April 2016, Cemalettin Koc notifications@github.com wrote:

stage-${project.artifactId}
${environmentName}

environmentRef is not set. It has default value.


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#99 (comment)

-- Aldrin Leal, aldrin@leal.eng.br / http://about.me/aldrinleal