Home > other >  com.amazonaws.services.elasticbeanstalk.model.TooManyApplicationVersionsException while deploying co
com.amazonaws.services.elasticbeanstalk.model.TooManyApplicationVersionsException while deploying co

Time:04-21

I am trying to deploy java webapp to elastic beanstalk. The build setup is configured in jenkins which automatically builds the code from git repository. There is a current environment running on elatic benastalk and I am trying to deploy the changes to same environmment. Any help would be appreciated.

Cleaning up temporary file /tmp/awseb-3661917639223333659.zip
ERROR: Failed to parse POMs
java.io.IOException: Deployment Failure
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.AWSEBDeploymentBuilder.perform(AWSEBDeploymentBuilder.java:197)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:946)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:896)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
    at hudson.model.Run.execute(Run.java:1818)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Caused by: java.util.concurrent.ExecutionException: com.amazonaws.services.elasticbeanstalk.model.TooManyApplicationVersionsException: You cannot have more than 1000 Application Versions. Either remove some Application Versions or request a limit increase. (Service: AWSElasticBeanstalk; Status Code: 400; Error Code: TooManyApplicationVersionsException; Request ID: 742c1239-08e0-463f-8471-8e52cbc1fb77)
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at hudson.remoting.LocalChannel$2.get(LocalChannel.java:77)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.DeployerRunner.perform(DeployerRunner.java:71)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.AWSEBDeploymentBuilder.perform(AWSEBDeploymentBuilder.java:193)
    ... 10 more
Caused by: com.amazonaws.services.elasticbeanstalk.model.TooManyApplicationVersionsException: You cannot have more than 1000 Application Versions. Either remove some Application Versions or request a limit increase. (Service: AWSElasticBeanstalk; Status Code: 400; Error Code: TooManyApplicationVersionsException; Request ID: 742c1239-08e0-463f-8471-8e52cbc1fb77)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1712)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1367)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1113)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:770)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:744)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:726)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:686)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:668)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:532)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:512)
    at com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient.doInvoke(AWSElasticBeanstalkClient.java:3191)
    at com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient.invoke(AWSElasticBeanstalkClient.java:3158)
    at com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient.invoke(AWSElasticBeanstalkClient.java:3147)
    at com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient.executeCreateApplicationVersion(AWSElasticBeanstalkClient.java:703)
    at com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient.createApplicationVersion(AWSElasticBeanstalkClient.java:674)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.cmd.DeployerCommand$CreateApplicationVersion.perform(DeployerCommand.java:174)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.cmd.DeployerChain.perform(DeployerChain.java:54)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.SlaveDeployerCallable.call(SlaveDeployerCallable.java:42)
    at br.com.ingenieux.jenkins.plugins.awsebdeployment.SlaveDeployerCallable.call(SlaveDeployerCallable.java:27)
    at hudson.remoting.LocalChannel$1.call(LocalChannel.java:52)
    at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

CodePudding user response:

Based on TooManyApplicationVersionsException You cannot have more than 1000 Application Versions

You need to remove some old application versions from Elastic beanstalk. You can do it as described here

CodePudding user response:

You need to remove previous versions - you can't go forever. See the "Deleting Previous Versions" on this page. Based on the docs it looks like you'll want to run

mvn beanstalk:clean-previous-versions -Dbeanstalk.daysToKeep=1 

if you want to remove by day or

mvn beanstalk:clean-previous-versions -Dbeanstalk.versionsToKeep=1 

if you want to remove by versions. This should be early in your build pipeline to clean up old versions.

  • Related