Timeouts when deploying to beanstalk

112 views
Skip to first unread message

Juan Carlos González González

unread,
Oct 3, 2014, 10:32:17 AM10/3/14
to beanstal...@googlegroups.com
Hi again Aldrin,

I'm going on with my tests. The problem now is that the environment never reaches green status because of a timeout problem. My pom.xml contains the following configuration:

   </build>
    <plugin>
      <groupId>br.com.ingenieux</groupId>
      <artifactId>beanstalk-maven-plugin</artifactId>
      <version>1.3.3-SNAPSHOT</version>
       <configuration>
          <applicationName>${platform-prefix}beanstalker</applicationName> 
          <s3Bucket>beanstalker</s3Bucket>
          <s3Key>${project.artifactId}/${project.build.finalName}-${maven.build.timestamp}.war</s3Key>
          <environmentName>${platform-prefix}beanstalker</environmentName>
          <cnamePrefix>${platform-prefix}beanstalker</cnamePrefix>
          <beanstalk.versionLabel>${maven.build.timestamp}</beanstalk.versionLabel>        
      </configuration>
    </plugin>
    </plugins>
  </build>

  <profiles>
  <profile>
  <id>aws-beta-deploy</id>
  <properties>
  <platform-prefix>beta-</platform-prefix>
                <maven.install.skip>true</maven.install.skip>
                <maven.deploy.skip>true</maven.deploy.skip>        
  <beanstalker.serverId>beta.aws.amazon.com</beanstalker.serverId>  
  <beanstalker.region>us-east-1</beanstalker.region>
  <beanstalk.environmentType>SingleInstance</beanstalk.environmentType>  
  <beanstalk.solutionStack>64bit Amazon Linux running Tomcat 7</beanstalk.solutionStack>
  <beanstalk.imageId>ami-fb8e9292</beanstalk.imageId>
  <beanstalk.instanceType>t1.micro</beanstalk.instanceType>
  <beanstalk.keyName>${platform-prefix}atlas</beanstalk.keyName>
<beanstalk.env.aws.elasticbeanstalk.control.LaunchType>Migration</beanstalk.env.aws.elasticbeanstalk.control.LaunchType>
<beanstalk.env.aws.autoscaling.updatepolicy.rollingupdate.RollingUpdateEnabled>false</beanstalk.env.aws.autoscaling.updatepolicy.rollingupdate.RollingUpdateEnabled>
<beanstalk.iamInstanceProfile>aws-elasticbeanstalk-ec2-role</beanstalk.iamInstanceProfile>
<beanstalk.env.aws.autoscaling.asg.MaxSize>1</beanstalk.env.aws.autoscaling.asg.MaxSize>
  </properties>
 
  <build>
  <defaultGoal>deploy</defaultGoal>
        <plugins>
           <plugin>
               <groupId>br.com.ingenieux</groupId>
               <artifactId>beanstalk-maven-plugin</artifactId>
               <version>1.3.3-SNAPSHOT</version>
               <executions>
                 <execution>
                   <id>default-deploy</id>
                   <phase>deploy</phase>
                   <goals>
                     <goal>upload-source-bundle</goal>
                     <goal>create-application-version</goal>
                     <goal>put-environment</goal>
                   </goals>
                 </execution>
               </executions>
           </plugin>
       </plugins>
  </build>
  </profile>
  </profiles>


All the process seems to be fine, but after several minutes with the message "waiting for EC2 instances....", I get the following error:

[WARNING] FAILURE
org.apache.maven.plugin.MojoExecutionException: Timed out
at br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand.executeInternal(WaitForEnvironmentCommand.java:243)
at br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor.WaitForEnvironmentCommand.executeInternal(WaitForEnvironmentCommand.java:33)
at br.com.ingenieux.mojo.beanstalk.cmd.BaseCommand.execute(BaseCommand.java:71)
at br.com.ingenieux.mojo.beanstalk.env.CreateEnvironmentMojo.createEnvironment(CreateEnvironmentMojo.java:282)
at br.com.ingenieux.mojo.beanstalk.env.CreateEnvironmentMojo.executeInternal(CreateEnvironmentMojo.java:238)
at br.com.ingenieux.mojo.beanstalk.env.PutEnvironmentMojo.executeInternal(PutEnvironmentMojo.java:61)
at br.com.ingenieux.mojo.aws.AbstractAWSMojo.execute(AbstractAWSMojo.java:358)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
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:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22:03 min
[INFO] Finished at: 2014-10-03T16:30:16+01:00
[INFO] Final Memory: 36M/450M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal br.com.ingenieux:beanstalk-maven-plugin:1.3.3-SNAPSHOT:put-environment (default-deploy) on project atlas-beanstalker-test: Timed out -> [Help 1]


I've done all the process from the AWS console with the same war and everything worked fine, so we can discard the war. Looks like when launched from plugin we're not capturing the signal that the environment is UP and it keeps waiting until timeout. I confirm you that when the error is thrown, the EC2 instance status is running.

I've tried several times and the error is thrown always, so we can discard network problems.

So, I don't know if the problem could be related to the configuration applied to beanstalker plugin. Please, could you take a look and let me know your opinion?.

KR,

Juan Carlos González


Aldrin Leal

unread,
Oct 3, 2014, 10:36:14 AM10/3/14
to beanstal...@googlegroups.com
EnvironmentName isn't used anymore (except on create/put-environment). You should set environmentRef as ${environmentName}.elasticbeanstalk.com

there's an issue for github outlining the reasoning behind it

--
-- Aldrin Leal, <ald...@leal.eng.br>
Master your EC2-fu! Get the latest ekaterminal public beta http://www.ingenieux.com.br/products/ekaterminal/

--
You received this message because you are subscribed to the Google Groups "beanstalker-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beanstalker-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Juan Carlos González González

unread,
Oct 6, 2014, 8:10:15 AM10/6/14
to beanstal...@googlegroups.com
Hi Aldrin.

Thanks for your help. I included environmentRef in my configuration but the problem persisted. However, I've seen that it was related to the AMI. I was using the same AMI ID applied to the instances launched from Beanstalk console (same stack, same instance type, etc.) The value is ami-fb8e9292. If I don't specify this value to the plugin, the environment is started properly. I've reviewed the AMI applied in this case and it does not match to the one used when the process is done from console.

KR,

Juan Carlos González

Aldrin Leal

unread,
Oct 6, 2014, 8:24:55 AM10/6/14
to beanstal...@googlegroups.com
You're refering to the AMI? Awesome, as I've never used it anyway :)

We rely on the SolutionStacks instead. Plus, AWS made some changes recently which simply breaks previous apps. So, make sure to run beanstalk:list-stacks to get a glimpse

Thanks

--
-- Aldrin Leal, <ald...@leal.eng.br>
Master your EC2-fu! Get the latest ekaterminal public beta http://www.ingenieux.com.br/products/ekaterminal/

Reply all
Reply to author
Forward
0 new messages