2
1

More than 3 years have passed since last update.

【トラブルシューティング】 CodeDeploy detected that the replacement task set is unhealthy.

Posted at

はじめに

CodeDeployにて以下のエラーメッセージの形で失敗してしまう事象に遭遇。

CodeDeploy detected that the replacement task set is unhealthy.

このエラーメッセージでググっても原因がわかる記事がなかったので作りました。

CodeDeploy.png

前提

  • ECS Fargate 利用
  • Blue/Green Deployment 設定のApplication、Deployment Group にて CodeDeployでECS Fargateへデプロイする作り
    • BlueなTarget GroupとGreenなTarget Group2つ存在
    • ELB (NLB) がリスナーでどちらかを指定している

原因

ECS ServiceのEventのログを確認することで原因がわかりました。

ELBのAvailability Zoneが1つしか設定されていない、かつ、ECS Service (Cluster)では複数AZ対応であったため、立ち上がるTaskのTarget Groupへは届かずエラーになっていました。

(service XXX-service, taskSet XXX-svc/9900447640397688999) (port 80) is unhealthy in target-group XXX-blue due to (reason Target is in an Availability Zone that is not enabled for the load balancer).

image.png

修正 / 解決

ELBの対象のAZをECS Serviceに合わせるように追加することで解決しました。

image.png

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1