elastic-beanstalk


cannot deploy - ERROR: You cannot have more than 500 Application Versions


I get the following error when deploying to EB:
ERROR: You cannot have more than 500 Application Versions. Either
remove some Application Versions or request a limit increase.
I went manually and deleted some versions.
I don't want deploys to fail because of this limit.
Is there a way in Elastic Beanstalk to auto-evict unused versions?
A feature was recently added to eb cli (v3.3) to cleanup old versions
https://m.reddit.com/r/aws/comments/340ce0/whats_the_thinking_behind_beanstalks_versioning/
Copying command from reddit link
$ eb labs cleanup-versions --help
usage: eb labs cleanup-versions [options...]
Cleans up old application versions.
optional arguments:
--num-to-leave NUM number of versions to leave DEFAULT=10
--older-than DAYS delete only versions older than x days DEFAULT=60
--force don't prompt for confirmation
At the time of writing this answer, eb labs cleanup-versions does not work for me: it returned No application versions to delete even when I had application versions.
As a workaround, I used this one-liner inspired from this answer (change the region and app name accordingly):
aws elasticbeanstalk describe-application-versions --output text --region=us-west-2 --query 'ApplicationVersions[*].[ApplicationName,VersionLabel,DateCreated]' | grep my-app-name | while read app ver date; do echo "deleting version $app $ver $date" ; aws elasticbeanstalk delete-application-version --region=us-west-2 --application-name $app --version-label $ver --delete-source-bundle; done
There's no built in way to do that, but the following ruby script performs just that. Simply schedule it using cron.
clearnup.rb:
application_name="myApp"
active_versions_shell_output = `aws elasticbeanstalk describe-environments --region=us-east-1 | grep git | awk '{gsub(/.*\:\ \"/,"",$0); print}'`
all_versions_shell_output = `aws elasticbeanstalk describe-applications --region=us-east-1 | grep git | awk '{gsub(/.*\ \"/,"",$0); print}'`
all_versions = all_versions_shell_output.split(/\n/).map{|x| x[0..57]}
active_versions = active_versions_shell_output.split(/\n/).map{|x| x[0..57]}
(all_versions - active_versions).each do |version_to_be_deleted|
puts "deleting #{version_to_be_deleted}"
`aws elasticbeanstalk delete-application-version --delete-source-bundle --application-name #{application_name} --version-label #{version_to_be_deleted}`
end
Now, they have added an admin UI page to delete all application versions:
Managing Application Versions

Related Links

ElasticBeanstalk not pinging worker HTTP path
elastic beanstalk Enhanced Health Overview : memory is in use
AWS Elastic Beanstalk - Source code in inner folder
Does anyone deploy meanio project to AWS Elasticbeanstalk?
AWS CodeDeploy?
Elastic Beanstalk randomly goes offline
How to enable parse server rest api
How to deploy config.json on elastic beanstalk
Error in AWS ElasticBeanStalk python 27 application that was running fine
Using elastic ip for amazon's ElasticBeanstalk instance
Creating custom scaling trigger for elastic beanstalk
Failing to deploy flask app on AWS Elastic Beanstalk environment
Elastic Beanstalk IAM developer permissions
Elastic beanstalk not using reserved instance
Updating AWS Elastic Bean has encountered a . How to resolve this?
How to automatically remove instances in EB whose status OutOfService is?

Categories

HOME
mongodb
svg
copy
crf
tags
saml
weight
middleware
tsql
format
c++14
cross-domain
microsoft-dynamics
range
clion
wavelet
eloqua
python-2.5
partitioning
raspberry-pi2
flow
aerospike
graphcool
jruby
powershell-v2.0
centroid
mlr
wso2cep
easendmail
rets
yii1.x
clappr
pmd
jsplumb
reed-solomon
petrel
background-process
jackrabbit
xaf
caldroid
eve
azure-management-api
mamp-pro
log4perl
ewsjavaapi
clientscript
domdocument
complement
maven-versions-plugin
playback
curly-braces
breach-attack
ifc
tachyon
topojson
redux-framework
olingo
cufft
nuitka
sliding
okuma
ctakes
julian
cvc4
omap
epplus-4
conditional-statements
sbrk
culture
prettyfaces
express-jwt
team-explorer-everywhere
jquery-backstretch
deepzoom
modalpopupextender
batman.js
android-lru-cache
mms-gateway
geometry-surface
progressdialog
hamlc
timestamp-with-timezone
51degrees
zmodem
ember-router
plinqo
renderaction
noaa
cassandra-0.7
cracker
sharepoint-feature
templatebinding

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App