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.