The most common error you will receive during health check failures for Amazon ECS tasks on AWS Fargate. The errors are:
(service AWS-service) (port 8080) is unhealthy in (target-grouparn:uxyztargetgroup/aws-targetgroup/123456789) due to (reason Health checks failed with these codes: [502]) or [request timeout]
(service AWS-Service) (port 8080) is unhealthy in target-group tf-20190411170 due to (reason Health checks failed)
If you encounter any of the above errors, then follow these troubleshooting steps:
If the container is mapped to port 80, then ensure that the container security group allows the load balancers inbound traffic on port 80.
You must verify whether the load balancer health ping port value is properly configured or not. If the port is not properly configured, the load balancer could de-register the container itself.
Verify the both ping port and health check path are properly configured.
Define a minimum grace period for health checks. This informs the service scheduler to skip Elastic Load Balancing health checks once a task has been instantiated for a pre-defined amount of time.
You should regularly monitor the CPU and memory statistics of the services.
Monitor your application logs for any application errors.
Check that your backend database is successfully connected.
Error 504 Troubleshooting
You will receive the error 504 due to any of the following reasons:
Load balancer fails to connect to the target before the connection expires.
Load balancer connected to the target, but it failed to respond before the idle timeout period expired.
Your subnet’s network access control list did not allow traffic from the targets to the load balancer nodes on the ephemeral ports.
(service AWS-Service) (port 8080) is unhealthy in target-group due to (reason Health checks failed with these codes:[504] If you receive the above 504 error, then try the following step:
Confirm that the backend has responded successfully without delay.
Set the correct response time-out value. The health check will fail if the value is lesser than the time required.
Also, Check your load balancer’s access logs for more information about issues.
Troubleshoot failed container health If you receive this error means your service is not integrated with the load balancer. But still the containers will use the health checks that your service cannot pass: (service AWS-Service) (task ff3e71a4-d7e5-428b-9232-2345657889) failed container health checks In case, if you have received the failed container health check error, follow the below steps:
First, confirm that you are passing the correct command to the container and syntax.
If the task has been running for some time, then check your application logs as well as the Amazon CloudWatch logs.
actsupport uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.