aws / aws/aws-codedeploy-agent

codedeploy-agent gets stuck on the wrong deployment ID, incorrectly reports missing scripts

Ouverte
#348 6 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
337
Forks
196
Merge moyen
10 h 54 min
PR mergées (30 j)
4

Description

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:

Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.4.1-2244_deb

The error I'm getting is this:

![aws-codedeploy-bad-script-ref](https://user-images.githubusercontent.com/7843659/222767599-904adfb2-3c2b-41e0-b953-3f65b811ac79.png)

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:

![aws-codedeploy-bad-script-ref-2](https://user-images.githubusercontent.com/7843659/222768457-d947fd99-ec6f-457b-a1e0-8879f98bbde2.png)

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 open `appspec.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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par examiner les journaux détaillés de codedeploy-agent et l’entrée /opt/codedeploy-agent/.version pour la version de l’agent OFFICIAL_1.4.1-2244_deb sur Ubuntu 18.04. Comparez la révision de déploiement correcte avec l’identifiant de déploiement erroné utilisé lors de l’ouverture de appspec.yml ; c’est terminé lorsque l’agent sélectionne la révision actuelle et trouve ses scripts application-event.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, ubuntu
Domaine
cloud, devops
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.