2019年8月6日火曜日

aws CodeDeployによりデプロイ失敗調査メモ

CodeDeployを使ってデプロイを行ってみましたが、失敗しました。調査した経過をメモしておきます。

まず、Console上のエラーを確認します。
The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems.
それをみてもよくわからないので、EC2にログインして、codedeployエージェントのログを確認します。

>less /var/log/aws/codedeploy-agent/codedeploy-agent.log
そしたら、以下のようなエラーが大量に出力されてました。

/opt/codedeploy-agent/bin/../lib/codedeploy-agent.rb:90:in `<main>'
2019-08-02 07:00:49 ERROR [codedeploy-agent(2040)]: booting child: error during start or run: SystemExit - exit - /opt/codedeploy-agent/lib/instance_agent/runner/child.rb:90:in `exit'
/opt/codedeploy-agent/lib/instance_agent/runner/child.rb:90:in `rescue in with_error_handling'
/opt/codedeploy-agent/lib/instance_agent/runner/child.rb:78:in `with_error_handling'
/opt/codedeploy-agent/lib/instance_agent/runner/child.rb:31:in `prepare_run'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/child.rb:64:in `block in prepare_run_with_error_handling'
/opt/codedeploy-agent/lib/instance_agent/runner/child.rb:78:in `with_error_handling'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/child.rb:63:in `prepare_run_with_error_handling'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/child.rb:20:in `start'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:206:in `block in spawn_child'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:204:in `fork'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:204:in `spawn_child'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:196:in `block in spawn_children'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:195:in `times'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:195:in `spawn_children'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:134:in `start'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:37:in `block in start'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:36:in `fork'
/opt/codedeploy-agent/vendor/gems/process_manager-0.0.13/lib/process_manager/master.rb:36:in `start'
/opt/codedeploy-agent/bin/../lib/codedeploy-agent.rb:43:in `block (2 levels) in <main>'
/opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/command_support.rb:126:in `call'
/opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/command_support.rb:126:in `execute'
/opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/app_support.rb:284:in `block in call_command'
/opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/app_support.rb:297:in `call'
/opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/app_support.rb:297:in `call_command'
/opt/codedeploy-agent/vendor/gems/gli-2.11.0/lib/gli/app_support.rb:79:in `run'
/opt/codedeploy-agent/bin/../lib/codedeploy-agent.rb:90:in `<main>'
2019-08-02 07:00:49 INFO  [codedeploy-agent(2036)]: master 2036: Received CHLD - cleaning dead child process
2019-08-02 07:00:49 INFO  [codedeploy-agent(2036)]: master 2036: been told to replace child 2040
2019-08-02 07:00:49 INFO  [codedeploy-agent(2036)]: master 2036: not enough child processes running - missing at least 1 - respawning
2019-08-02 07:00:49 INFO  [codedeploy-agent(2036)]: Started master 2036 with 1 children
2019-08-02 07:00:54 INFO  [codedeploy-agent(2036)]: master 2036: Spawned child 1/1
2019-08-02 07:00:54 INFO  [codedeploy-agent(2513)]: On Premises config file does not exist or not readable
2019-08-02 07:00:54 INFO  [codedeploy-agent(2513)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor: Archives to retain is: 5}
2019-08-02 07:03:06 ERROR [codedeploy-agent(2513)]: InstanceAgent::Plugins::CodeDeployPlugin::CodeDeployControl: Error during certificate verification on codedeploy endpoint https://codedeploy-commands.ap-northeast-1.amazonaws.com
2019-08-02 07:03:06 ERROR [codedeploy-agent(2513)]: Error validating the SSL configuration: Invalid server certificate
2019-08-02 07:03:06 ERROR [codedeploy-agent(2513)]: booting child: error during start or run: SystemExit - Stopping CodeDeploy agent due to SSL validation error. - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:64:in `abort'
/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:64:in `validate'
/opt/codedeploy-agent/lib/instance_agent/agent/base.rb:11:in `runner'
/opt/codedeploy-agent/lib/instance_agent/runner/child.rb:32:in `block in prepare_run'
/opt/codedeploy-agent/lib/instance_agent/runner/child.rb:78:in `with_error_handling'
どうやっらインスタンスから外部に接続が失敗したようです。

ping google.co.jp
案の定失敗しました。ネットワーク接続を確認したとろこ、ルートテーブルの設定が足りてなかったです。ルートを追加したらうまくインテーネットに接続ができて、デプロイもできるようになりました。


0 件のコメント:

コメントを投稿