-
Notifications
You must be signed in to change notification settings - Fork 186
CodeDeploy agent does not use force option of ruby symlink filetools #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This needs to be in place. We are running into it. Do you want to me open up a PR for this? |
Hello Huckphin, That would be great ! However I saw that in fact it should be fixed, but only if --file-exists-behavior is set to OVERRIDE |
@hegyre That is good information. We are consistently using the One thing that is very abnormal to all of our services is that we have consolidated all of our frontend code from six different services into one service. There was a lot of duplication across our services, and we are going to pare it all down, but our deployment artifact is very large: 600 MB. This is orders of magnitude larger than any other service that we are using. For the record, at the moment, I believe that this is a red herring, and not the real issue. The other thing that could be related is that I have attached a 100 GB ebsmount to each member of the cluster that requires these large tarballs to be deployed. To accomodate this, I have setup a symlink:
I am thinking that this could be the cause, but, I have performed this same routine for a handful of our other services that required it, and they seem to be deploying without encountering this issue. Also, on troubleshooting this, I have attempted to make it work by deleting the CodeDeploy application and the CodeDeploy deploymentgroup for this cluster of servers to no effect. Maybe...I need to install a new version of the CodeDeploy agent? Is there an easy way to do that? Hope this helps. |
About symlink /opt/codedeploy-agent to an EBS mount, I don't think there can be an issue there, because the issue is when codedeploy agent operate at the "install" stage to the destination directory which is not /opt/codedeploy-agent Our artifact is about 600 MB too because we are deploying lots of different files for differents countries, but the size should not be an issue About the new version of the agent, we are already using the verson 1.0.1.1352 Here's the page to update the agent: https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-update.html At least, we have made a work-around by using a beforeInstall script which removes the destination directory before the "install" event by the codedeploy agent. So there is no more orphaned symlinks. But it would be good to have it done natively by the agent itself |
Nevermind my last suggestions. @hegyre you are right it was not related to the Symlink issue at all. That was a red herring. The issue was related to how I was provisioning the mounts, completely unrelated to anything with the I stopped using snapshots to provision the volume, and the issue went away. |
I am adding this to our task list. |
now is 2022 and this is still a bug in the latest codedeploy agent I have to use the BeforeInstall hook to delete all my symbolic link files to avoid this problem, please merge the pull... |
Hello team,
We are facing an issue where CodeDeploy is unable to OVERWRITE symlinks during an in-place deployment.
This is hapening since we use --file-exists-behavior "OVERWRITE" option in the deploy script (aws deploy create-deployment).
I've digged, and:
This is the error I got from CodeDeploy:
In /usr/share/ruby/fileutils.rb:349, we have:
In /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/install_instruction.rb:235, we have:
The comments clearly shows that It's not expected to have a CopyCommand here.
I think that this def was written when the option --file-exists-behavior "OVERWRITE" was not yet implemented.
Now that we can use this option, you should add :force => true to the symlink parameter, like this:
As a last word, I specify here that the Deployment is a new deploy and application and thus it does not have the "history" of a previous one. That is why I use option --file-exists-behavior "OVERWRITE"
The text was updated successfully, but these errors were encountered: