aws / aws/aws-codedeploy-agent
file already exists deployment failure and duplicate log entries
- Lenguaje dominante
- Rust
- Estrellas
- 337
- Forks
- 195
- Merge medio
- 10 h 54 min
- PR fusionados (30 d)
- 4
Descripción
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
Guía de contribución
Línea de trabajo
No se nombran archivos fuente ni pruebas. Comienza con el inicio del servicio del agente de CodeDeploy y la ruta de extracción del archivo de deployment, correlacionando las líneas de log duplicadas con los errores de appspec.yml y App_WebReferences. Se considera terminado cuando se identifica una causa reproducible y se confirma que los deployments y rollbacks se completan sin procesamiento duplicado ni fallos de extracción.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- aws, ruby
- Área
- cloud, devops
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100