aws / aws-codedeploy-agent

Host Agent for AWS CodeDeploy
https://aws.amazon.com/codedeploy
Apache License 2.0
328 stars 188 forks source link

Codedeploy failing randomly at Install not finding appspec.yml #380

Open daniterrin opened 11 months ago

daniterrin commented 11 months ago

Hi, I have a Lightsail instance configured to work with CodeDeploy. When I try to deploy I am sometimes getting an error at the Install event saying that the appspec.yml didn't exist. However, sometimes the appspec.yml is not there and some others it is.

Error in CodeDeploy console logs

No such file or directory @ rb_sysopen - /opt/codedeploy-agent/deployment-root/7e9847e4-846e-4609-b85b-c22a3fa0a50d/d-KHM59H4R1/deployment-archive/appspec.yml

The codedeploy-agent logs show the following

2023-10-02T14:06:25 ERROR [codedeploy-agent(3375)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: Errno::ENOENT - No such file or directory @ rb_sysopen - /opt/codedeploy-agent/deployment-root/7e9847e4-846e-4609-b85b-c22a3fa0a50d/d-KNLJWL3R1/deployment-archive/appspec.yml - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:291:in read' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:291:invalidate_app_spec_hooks' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:286:in default_app_spec' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:183:inblock in ' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:115:in execute_command' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:137:inprocess_command' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:119:in acknowledge_and_process_command' /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:99:inblock in perform' /opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:363:in run_task' /opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:352:inblock (3 levels) in create_worker' /opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:335:in loop' /opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:335:inblock (2 levels) in create_worker' /opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in catch' /opt/codedeploy-agent/vendor/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:inblock in create_worker' /opt/codedeploy-agent/vendor/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context' 2023-10-02T14:06:25 WARN [codedeploy-agent(3375)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PutHostCommandComplete: "Code Error"

The versions are as follows:

codedeploy-agent: 1.6.0-49 OS: Debian GNU/Linux 11 (bullseye) Ruby: ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23)