Deployment using CodeDeploy failing at "install" step due to error "File already exists" Deployment using CodeDeploy failing at "install" step due to error "File already exists" jenkins jenkins

Deployment using CodeDeploy failing at "install" step due to error "File already exists"


As part of its processes, CodeDeploy will look for information on previously deployed files for the app/deployment group. If then it uses this info to delete the existing file(s), preparing for the deployment of the new revisions, as needed.

http://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-steps.html#deployment-rollback

In this case, there is some inconsistent reference due to manual cleanup you may have done previously.

A good option for all deployments is to simply delete all files in the deployment folder during the BeforeInstall hook. This will fix this issue now and going forward.


This is fixable. Codedeploy throws an error on files it hasn't deployed itself. But there is an option to cover this during a deployment.

"Content options:Choose the action for AWS CodeDeploy to take during a deployment when a file on a target instance has the same name as a file in the application revision, for the same target location."

You can choose fail, overwrite and retain. It depends on your situation.

You can find more information