-
Notifications
You must be signed in to change notification settings - Fork 186
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
codedeploy-agent gets stuck on the wrong deployment ID, incorrectly reports missing scripts #348
Comments
Can you provide a clear set of steps for reproduction? |
It happened for me with a large project, so it's hard for me to reproduce this in a smaller setup. I do realize that it doesn't make it easier for you and will understand if you want to close this issue as unreproducible. Having said that, I think the problem is in how I have 3 source repositories used by a CodePipeline instance, say Thinking that This is what I think broke Once I realized that CodeDeploy wasn't meant to work in this configuration, I restructured the deployment stage as a series of sequential action groups, but it appears that something was damaged under I had to delete all three deployment applications, along with their deployment groups and create new ones to make sequential action groups work in that deployment stage. This step fixed the broken deployment stage with sequential action groups and I the pipeline now works as intended. |
Hey Andre, I suspect what you are seeing is not a bug in the codedeploy-agent but rather the (unexpected) default behavior from Codedeploy itself: The "ApplicationStop" lifecycle hook is always called from the previous deployment. That's why you are seeing two different deployment IDs in your screenshot. The reason for this, is that ApplicationStop is run before DownloadBundle, therefore the stop script from the previous deployment is used to stop the application, then the new artifact is downloaded and the actually new deployment begins. EDIT: Just saw the "that other deployment ID isn't even for this application, but another application that was deployed to the same VM at a different time" part. I'm not sure if the agent even has an understanding of "applications" or just has a list of deployment IDs for this instance and then just blindly runs the application stop from the previous deployment. |
@fleaz Thank you for the insights about stopping the application. It does make sense to use the script from the previous deployment, not only because it's done before the next one is downloaded, but even more so because the stopping script in the incoming app may have changed and won't work for stopping the previous app.
It appears that CodeDeploy is aware of applications because now I am deploying applications From what I was observing, it is as if CodeDeploy uses some shared area for all deployments and when multiple deployments ran at the same time, one deployment stomped on another. Perhaps folks testing CodeDeploy could set up 3 applications to run and parallel and see if it works. Not saying it should, but CodePipeline docs should probably highlight that parallel actions against the same VM should not be set up. |
That indeed sounds like your problem. They all get saved to Your Codedeploy agent config (Probably saved at I would try to increase the |
Thanks for the heads-up. My app
The problem was actually running deployments for In other words, it's the parallelism in multiple CodeDeploy actions running in parallel vs. the limitation of maximum number of deployments being tracked. The former messed it up so much that I had to recreate a bunch of configuration to get it working again. The latter is something that can be managed via configuration, as you pointed out. Thanks again for your insights. Much appreciated. |
CodeDeploy agent keeps trying to access an invalid application revision and fails to find scripts to run in application events. The original configuration where this occurred is a CodePipeline instance, but now when I create a deployment just for this application and deployment group, it keeps selecting the same bad deployment revision.
It's happening on Ubuntu 18.04. Not sure how to obtain
codedeploy-agent
version, as it doesn't implement--version
. The closest I can see is in the logs:The error I'm getting is this:
Notice that the deployment ID following the deployment group ID is different from the actual deployment shown in details. This is the problem - that other deployment ID isn't even for this application, but another application that was deployed to the same VM at a different time.
Checking this deployment, it is properly picking up correct build artifacts, which do contain the script that it reports to be missing:
The revision location shown in details does contain the script that is reported as missing, so
codedeploy-agent
is definitely trying to refer to a bogus deployment ID when it is trying to locate the application revision.Looking at the
codedeploy-agent
logs, it just reports this error that is visible in UI and no other useful information. In verbose mode, it references the correct application revision and, on the next log line after this, is trying to openappspec.yml
for the bogus deployment ID reported in the error.I also noticed that deployment ID referenced in revision details in the screenshot above is different for manually-created deployments in that it may be different from the current deployment ID in the same screenshot and seems to be referring to the deployment ID that was active at the time CodePipeline was running, when it got a notification from the CodeBuild stage. Mentioning this because it sounds plausible that this is where the original deployment ID mix-up happened.
The text was updated successfully, but these errors were encountered: