Closed dskrvk closed 5 years ago
An excerpt from the log with debug level enabled (for some reason every line in my log is doubled, but I removed the duplicates here):
2016-03-28 22:52:48 DEBUG [codedeploy-agent(22961)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Successfully parsed the deployment spec 2016-03-28 22:52:48 DEBUG [codedeploy-agent(22961)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Creating deployment root directory /opt/codedeploy-agent/deployment-root/e445d2a1-8733-4850-aab0-1ac6d1f587c7/d-ZN9F64XVE 2016-03-28 22:52:48 DEBUG [codedeploy-agent(22961)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Executing DownloadBundle command for execution CodeDeploy/us-east-1/Prod/arn:aws:sds:us-east-1:663148821630:deployment/d-ZN9F64XVE 2016-03-28 22:52:48 DEBUG [codedeploy-agent(22961)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Downloading artifact bundle from bucket 'codepipeline-us-east-1-423929197064' and key '[redacted]/AAdCJYb.zip', version '', etag '7cb7551a4003c7b9234c386e79ab0848' 2016-03-28 22:52:48 DEBUG [codedeploy-agent(22961)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PutHostCommandComplete: "Code Error" ... 2016-03-28 22:52:48 ERROR [codedeploy-agent(22961)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: Errno::ENOENT - No such file or directory - /opt/codedeploy-agent/deployment-root/e445d2a1-8733-4850-aab0-1ac6d1f587c7/d-ZN9F64XVE/bundle.tar - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:208:in
initialize' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:208:in
open' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:208:in `download_from_s3'
You are correct. We have created task to fix this issue and roll out updated version soon. Thanks for letting us know!
This fix is written up and will be released in next release of host agent.
So, has this been released yet?
Btw, if changing this value to 1
or 0
will superfluous copies be automatically deleted?
was this released?
any updates ?
Hi,
We are currently working on the fix. The deployments will fail because the agent will not start with the max_revisions set to 0. Right now only integers 1 or greater work.
Thank you
@mxro Superfluous copies will not be automatically deleted immediately. They will be deleted at the beginning of the next deployment.
Hi,
Through many talks with managers, we have concluded we do not plan on supporting setting max_revision to 0 because of rollbacks and other functionality that relies on this. There are ways to work around this if you'd like. you can turn on the setting to ignore ApplicationStop failures and use a script to remove all old deployments.
Thank you
Please refer to this post for the issue description: https://forums.aws.amazon.com/thread.jspa?messageID=711273
Based on my reading of the code, this is what happens:
command_executor#execute_command
is called with command =DownloadBundle
.download_bundle
which performs a cleanup: https://github.com/aws/aws-codedeploy-agent/blob/master/lib/instance_agent/plugins/codedeploy/command_executor.rb#L71.:max-revisions = 0
,cleanup_old_archives
removes all the deployment directories except for the last successful one, including the newly-created one.download_from_s3
: https://github.com/aws/aws-codedeploy-agent/blob/master/lib/instance_agent/plugins/codedeploy/command_executor.rb#L207.You either need to keep track of and exclude the newly-created directory from the cleanup, or perform the cleanup before creating new directories.
After I set
:max-revisions
to 2, the deployments were able to proceed.