Open ericyancey opened 2 years ago
Can you please provide a little more information?
Sure thing! I actually have an update on this as well.
Here are answers to your questions:
Does SSM update CodeDeploy Agent on a set schedule, or do you kick off the updates manually? Manual
What version of CodeDeploy Agent were you running before that worked? 1.01
What version of CodeDeploy Agent did SSM install recently? 1.3.2
Are these EC2 or on-premise instances? If EC2, what region? What AMI? All of these are EC2 instances running in us-east-1 and the AMI for at least one instance was ami-05bb2dae0b1de90b3
If EC2, are you using CodeDeploy's autoscaling group integration to deploy to your instances? We are not using autoscaling
what file_exists_behavior setting are you using? fileExistsBehavior: 'OVERWRITE'
Additional Information: We triggered manual installations of CodeDeployAgent from SSM and cycled through the versions and tested the deployment until we got one to work. Deployments using versions 1.3.2, 1.3.1, 1.2.1 all failed with the same error mentioned in my original post.
But after installing 1.1.2, the deployments worked again!
Thank you for any help you can provide on this.
Eric
I wasn't able to find ami-05bb2dae0b1de90b3. Did you build it yourself, maybe using EC2 Image Builder?
If not, can you describe the filters/search parameters you used to find this AMI?
It looks like that particular AMI has been removed. The AMI was likely created after we hardened an AWS-provided image and then sysprepped it in the process of renaming it to join a domain.
However, this issue is happening with other instances from other AMIs, so I don't know that the base image has anything to do with it. I'm happy to gather any other information that you need.
thanks
Hi,
Sorry to reply on an old thread, but this issue still persists. We have been running version 1.0.1.1597 for some time now after not having any success with newer versions. I noticed a new version was released this spring so I installed it but the deployments fail.
This may not be an issue, but one thing I noticed is the log files for the newer agent have duplicated entries. In the log files for the old agent, I see this:
2023-07-14T05:35:02 DEBUG [codedeploy-agent(3020)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: PollHostCommand: Host Command = nil
2023-07-14T05:35:03 DEBUG [codedeploy-agent(3020)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PollHostCommand:
2023-07-14T05:35:03 INFO [codedeploy-agent(3020)]: Version file found in C:/ProgramData/Amazon/CodeDeploy/.version with agent version OFFICIAL_1.0.1.1597_msi.
2023-07-14T05:35:49 INFO [codedeploy-agent(3020)]: [Aws::CodeDeployCommand::Client 200 45.691622 0 retries] poll_host_command(host_identifier:"arn:aws:ec2:us-
However, for the new agent every line is duplicated throughout:
2023-07-17T13:10:50 DEBUG [codedeploy-agent(1804)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: PollHostCommand: Host Command = nil
2023-07-17T13:10:50 DEBUG [codedeploy-agent(1804)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: PollHostCommand: Host Command = nil
2023-07-17T13:10:51 DEBUG [codedeploy-agent(1804)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PollHostCommand:
2023-07-17T13:10:51 DEBUG [codedeploy-agent(1804)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PollHostCommand:
2023-07-17T13:10:51 INFO [codedeploy-agent(1804)]: Version file found in C:/ProgramData/Amazon/CodeDeploy/.version with agent version OFFICIAL_1.6.0.49_msi.
2023-07-17T13:10:51 INFO [codedeploy-agent(1804)]: Version file found in C:/ProgramData/Amazon/CodeDeploy/.version with agent version OFFICIAL_1.6.0.49_msi.
2023-07-17T13:11:36 INFO [codedeploy-agent(1804)]: [Aws::CodeDeployCommand::Client 200 45.235753 0 retries] poll_host_command(host_identifier:"arn:aws:ec2:us-e
2023-07-17T13:11:36 INFO [codedeploy-agent(1804)]: [Aws::CodeDeployCommand::Client 200 45.235753 0 retries] poll_host_command(host_identifier:"arn:aws:ec2:us-
We have been successfully deploying our application to numerous Windows 2019 servers for some time now until this past weekend. A round of operating system updates were applied and it appears that SSM upgrade CodeDeploy at the same time. We attempted a deployment immediately after and it failed.
The error happens after the zip file is downloaded and during the extraction process. The error is:
Exception calling "ExtractToDirectory" with "2" argument(s): "The file 'C:\ProgramData\Amazon\CodeDeploy\ce282efb-0b60-4d7f-8e29-233d4ce2710a\d-PMKMQMU3I\deployment-archive\appspec.yml' already exists."
I found a solution to the original error message above. There was an issue in creating the bundle for the deployment where there were TWO appspec.yml files in the bundle in the root path. It is beyond me why the Powershell Compress-Archive command allows you to add mulitples of the same file into the same path, but when newer versions of CodeDeploy attempted to extract the archive the above error was generated.
Oddly enough, older versions of CodeDeploy didn't seem to mind that there were multiples.
We have been successfully deploying our application to numerous Windows 2019 servers for some time now until this past weekend. A round of operating system updates were applied and it appears that SSM upgrade CodeDeploy at the same time. We attempted a deployment immediately after and it failed.
The error happens after the zip file is downloaded and during the extraction process. The error is:
I've seen numerous articles on rectifying this, but none seem to apply to our situation. What is odd is that every line in the CodeDeploy log file seems to be duplicated after the upgrade, almost as if there are two instances of it running. Here is a sample from the time the service is started:
After the initial error, a rollback is triggered that also fails. The AWS console reports the same error for both the initial deployment and the rollback:
Once it is all said and done, I checked the deployment folder and the zip file seems to have been extracted cleanly - the appsec file is there and the App_WebReferences.
Any help would be greatly appreciated, and please let me know if there is any other information I can provide to help remedy this.
Thanks