ingenieux/beanstalker

0.2.7-RC5 fails to terminate env in replace-environment

Closed this issue · 5 comments

This is what I see:

[INFO] --- beanstalk-maven-plugin:0.2.7-RC5:replace-environment (default) @ FOO-rest ---
     [exec] [WARNING] You should encrypt your passwords. See http://beanstalker.ingenieux.com.br/security.html for more information
     [exec] [INFO] Creating a new environment on FOO-1.elasticbeanstalk.com
     [exec] [INFO] Waiting for environmentId e-qzxbnxbdap to get into Ready state
     [exec] [INFO] Will wait until Thu Oct 04 18:02:42 UTC 2012 for environment e-qzxbnxbdap to get into Ready
     [exec] [INFO] Terminating environmentId=e-qzxbnxbdap
     [exec] [WARNING] FAILURE
     [exec] org.apache.maven.plugin.MojoFailureException: Failed
     [exec]     at br.com.ingenieux.mojo.aws.AbstractAWSMojo.handleException(AbstractAWSMojo.java:379)
     [exec]     at br.com.ingenieux.mojo.beanstalk.cmd.BaseCommand.handleException(BaseCommand.java:84)
     [exec]     at br.com.ingenieux.mojo.beanstalk.cmd.BaseCommand.execute(BaseCommand.java:76)
     [exec]     at br.com.ingenieux.mojo.beanstalk.env.ReplaceEnvironmentMojo.terminateAndWaitForEnvironment(ReplaceEnvironmentMojo.java:181)
     [exec]     at br.com.ingenieux.mojo.beanstalk.env.ReplaceEnvironmentMojo.executeInternal(ReplaceEnvironmentMojo.java:102)
     [exec]     at br.com.ingenieux.mojo.aws.AbstractAWSMojo.execute(AbstractAWSMojo.java:340)
     [exec]     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
     [exec]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
     [exec]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
     [exec]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
     [exec]     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
     [exec]     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
     [exec]     at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
     [exec]     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
     [exec]     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
     [exec]     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
     [exec]     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
     [exec]     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
     [exec]     at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
     [exec]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [exec]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     [exec]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [exec]     at java.lang.reflect.Method.invoke(Method.java:601)
     [exec]     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
     [exec]     at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
     [exec]     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
     [exec]     at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
     [exec] Caused by: Status Code: 400, AWS Service: AWSElasticBeanstalk, AWS Request ID: c1468110-0e4d-11e2-b04a-3375f21c6068, AWS Error Code: InvalidParameterValue, AWS Error Message: Cannot terminate environment named FOO-1. It is currently pending creation.

The problem is that it is trying to terminate environment just created: Cannot terminate environment named FOO-1. It is currently pending creation.. Am I doing something wrong? I think it worked before.

Would be great to report the cause of waitForEnvironment() exception into log

As far as I understand this is what is happening:

  1. A new environment is created
  2. It doesn't reach Ready state (or some other problem happens in waitForEnvironment())
  3. You're trying to terminate this newly created environment
  4. This operation fails and we have two environments in EBT running at the same time

Dup of #20

It worked, but the semantics of replace-environment changed a while - See if removing will suffice.

Just in case: The Elastic Beanstalk API shows "Ready" when you supply an ApplicationName w/ EnvironmentId. Forwarded to AWS. Searching for Workarounds

http://screencast.com/t/ChqzJyYplnfh