aws / aws/aws-codedeploy-agent

file already exists deployment failure and duplicate log entries

Aperta
#322 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
337
Fork
195
Merge medio
10h 54m
PR unite (30g)
4

Descrizione

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'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:

```
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: CodeDeploy Instance Agent Service: started
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: CodeDeploy Instance Agent Service: started
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: On Premises config file does not exist or not readable
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: On Premises config file does not exist or not readable
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Configuring deploy control client: Region="us-east-1"
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Configuring deploy control client: Region="us-east-1"
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Deploy control endpoint override=
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Deploy control endpoint override=
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Enable auth policy = false
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Enable auth policy = false
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: CodeDeploy endpoint: https://codedeploy-commands.us-east-1.amazonaws.com
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: CodeDeploy endpoint: https://codedeploy-commands.us-east-1.amazonaws.com
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Archives to retain is: 5}
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Archives to retain is: 5}
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Initializing Host Agent: Host Identifier = arn:aws:ec2:us-east-1:zzz:instance/zzz
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Initializing Host Agent: Host Identifier = arn:aws:ec2:us-east-1:z:instance/zzz
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Validating CodeDeploy Plugin Configuration
2022-06-12T06:09:36 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Validating CodeDeploy Plugin Configuration
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: CodeDeploy endpoint: https://codedeploy-commands.us-east-1.amazonaws.com
2022-06-12T06:09:36 INFO [codedeploy-agent(1972)]: CodeDeploy endpoint: https://codedeploy-commands.us-east-1.amazonaws.com
2022-06-12T06:09:37 INFO [codedeploy-agent(1972)]: CodeDeploy endpoint: https://codedeploy-commands.us-east-1.amazonaws.com
2022-06-12T06:09:37 INFO [codedeploy-agent(1972)]: CodeDeploy endpoint: https://codedeploy-commands.us-east-1.amazonaws.com
2022-06-12T06:09:37 DEBUG [codedeploy-agent(1972)]: Current deploy control endpoint: https://codedeploy-commands.us-east-1.amazonaws.com
2022-06-12T06:09:37 DEBUG [codedeploy-agent(1972)]: Current deploy control endpoint: https://codedeploy-commands.us-east-1.amazonaws.com
2022-06-12T06:09:41 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: CodeDeploy Plugin Configuration is valid
2022-06-12T06:09:41 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: CodeDeploy Plugin Configuration is valid
2022-06-12T06:09:41 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PollHostCommand:
2022-06-12T06:09:41 DEBUG [codedeploy-agent(1972)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PollHostCommand:
2022-06-12T06:09:41 INFO [codedeploy-agent(1972)]: Version file found in C:/ProgramData/Amazon/CodeDeploy/.version with agent version OFFICIAL_1.3.2.1902_msi.
2022-06-12T06:09:41 INFO [codedeploy-agent(1972)]: Version file found in C:/ProgramData/Amazon/CodeDeploy/.version with agent version OFFICIAL_1.3.2.1902_msi.
```
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:

```
Error Code: Unknown
Message: No such file or directory @ rb_sysopen - C:\ProgramData/Amazon/CodeDeploy/ce282efb-0b60-4d7f-8e29-233d4ce2710a/d-OFHJUGT3I/deployment-archive/web\App_WebReferences\
```
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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Non vengono indicati file sorgente né test. Inizia dall’avvio del servizio dell’agente CodeDeploy e dal percorso di estrazione dell’archivio di deployment, correlando le righe di log duplicate con gli errori di appspec.yml e App_WebReferences. Il lavoro è completato quando viene identificata una causa riproducibile e viene confermato che deployment e rollback terminano senza elaborazioni duplicate né errori di estrazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, ruby
Ambito
cloud, devops
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.