ECS task remains unhealthy even though call to /healthz endpoint is shown to be successful in logs

0

Hello,

The issue is that the ECS task remains unhealthy even though I can see the ESC agent calls to /healthz path in the logs and it is succeeding. the task remains unhealthy and so the load balancer doesn't seem to route the task to it because of that. so my question is how do I troubleshoot this kind of issue and any suggestions as to why the task is unhealthy even though the log is filled with 200 responses to the health endpoint.

Thanks, any help is appreciated.

/Healthz logs

Task dashboard

Groot
已提問 4 個月前檢視次數 154 次
3 個答案
1
已接受的答案

It turns out it was one of the targets in my target groups that have become unresponsive. so I deregistered it and everything is working fine now. Thanks for the assistance. Cheers.

Groot
已回答 4 個月前
profile picture
專家
已審閱 2 個月前
1

Hello.

How about increasing the interval of "healthCheckGracePeriodSeconds" in the ECS service settings?
By increasing this value, the ECS task will be RUNNING until the specified number of seconds has passed.
We believe that if the health check status passes during this grace period, there is no problem.
https://repost.aws/knowledge-center/fargate-alb-health-checks
https://docs.aws.amazon.com/AmazonECS/latest/userguide/service_definition_parameters.html#sd-networkconfiguration

Just to be sure, is the ALB health check configured to succeed if it receives a status code of 200?

profile picture
專家
已回答 4 個月前
  • Thank you, but I already did. if you check on the second picture, the value is set at 1800. unless if you think i should set it higher?, and yes the ALB response code i used a range of 200-299

1

Please check the task definition to ensure that it's correctly set up, especially the network mode, container definitions, and port mappings. Service Dependencies: Check if your service has dependencies (like a database) that might not be ready or accessible, causing the service to be unhealthy.

profile picture
Jagan
已回答 4 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南