- Newest
- Most votes
- Most comments
The 503 Service Temporarily Unavailable error you're experiencing with your load balancer can occur due to several reasons. Based on the information provided, here are some potential causes and solutions:
-
No healthy instances: Ensure that you have healthy instances registered with your target group. The screenshot of your target group shows 0 healthy targets, which is likely the primary cause of the 503 error.
-
Insufficient capacity: Make sure you have at least one healthy instance in each Availability Zone that your load balancer is configured to use.
-
Instance health checks: Verify that your instances are passing the health checks configured in your target group. Review the health check settings and ensure they are appropriate for your application.
-
Security groups and network ACLs: Check that your security groups and network ACLs allow traffic from the load balancer to your instances on the appropriate ports.
-
Application issues: If your instances are running but not responding correctly, investigate any application-level problems that might be causing the instances to fail health checks.
-
SSL/TLS configuration: Since you mentioned HTTPS, ensure that your SSL/TLS certificate is properly configured on the load balancer and matches the domain you're using to access the site.
To resolve the issue:
- Register at least one healthy instance in your target group.
- Verify that your instances are running and configured correctly.
- Check the health check settings in your target group and adjust if necessary.
- Review your security group and network ACL settings to allow traffic from the load balancer.
- Monitor the CloudWatch metrics for your load balancer, particularly the HealthyHostCount and UnHealthyHostCount, to gain more insights into the problem.
If you continue to experience issues after addressing these points, you may need to investigate further by checking your application logs and load balancer access logs for more detailed error information.
Sources
Troubleshoot a Classic Load Balancer: HTTP errors - Elastic Load Balancing
Resolve RequestCount metric drop in Application Load Balancer | AWS re:Post
Hello,
** A few questions I tried to pick out which I feel might be relevant for the issues you are currently experiencing:**
-
Which subnet is the ALB listening in and which subnets are the targets in?
-
Does the load balancer's security group allow ingress traffic on port 443?
-
Is the ALB request pass through https or are you terminating https on the ALB?
-
Which subnet is your alb listening in and which subnet is your instance in?
-
Double-check the ALB Securite Group (inbound rules).
-
Target Securite Group (inbound rules).
-
Increase the log level (adjust the logging framework, if possible) to DEBUG or TRACE mode. NOTE: Post logs, if possible.
-
Verify the securite group of the target instances allows the securite group of the ALB.
Source: AWS Load Balancer 504 Gateway Timeout https://www.reddit.com/r/aws/comments/csh1t4/aws_load_balancer_504_gateway_timeout/
** The 'Scheme' on the Details page is 'Internet-facing' > ** Taken from Elastic Load Balancing > Application Load Balancers> Source: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html#client-cannot-connect
Clients cannot connect to an internet-facing load balancer
If the load balancer is not responding to requests, check for the following issues: Your internet-facing load balancer is attached to a private subnet You must specify public subnets for your load balancer. A public subnet has a route to the Internet Gateway for your virtual private cloud (VPC).
A security group or network ACL does not allow traffic The security group for the load balancer and any network ACLs for the load balancer subnets must allow inbound traffic from the clients and outbound traffic to the clients on the listener ports.
--> Error reason codes If the load balancer cannot complete an authenticate action, the load balancer stores one of the following reason codes in the error_reason field of the access log. The load balancer also increments the corresponding CloudWatch metric.
Source: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html
--> Clients cannot connect to an internet-facing load balancer https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html#client-cannot-connect
If the load balancer is not responding to requests, check for the following issues:
Your internet-facing load balancer is attached to a private subnet You must specify public subnets for your load balancer. A public subnet has a route to the Internet Gateway for your virtual private cloud (VPC).
A security group or network ACL does not allow traffic The security group for the load balancer and any network ACLs for the load balancer subnets must allow inbound traffic from the clients and outbound traffic to the clients on the listener ports.
Access logs for your Application Load Balancer https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html
- Access logs is an optional feature of Elastic Load Balancing that is disabled by default.
- After you enable access logs for your load balancer, Elastic Load Balancing captures the logs and stores them in the Amazon S3 bucket that you specify as compressed files. You can disable access logs at any time.
- You are charged storage costs for Amazon S3, but not charged for the bandwidth used by Elastic Load Balancing to send log files to Amazon S3. For more information about storage costs, see Amazon S3 pricing.
Access log files https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html#access-log-file-format
- Elastic Load Balancing publishes a log file for each load balancer node every 5 minutes.
Access log entries https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html#access-log-entry-format
- Elastic Load Balancing logs requests sent to the load balancer, including requests that never made it to the targets
How do I troubleshoot 503 (service unavailable) errors from my Application Load Balancer? Source: https://repost.aws/knowledge-center/alb-troubleshoot-503-errors
TODO: Target-type > Instance based.
Check target health and connectivity.
answered 2 years ago
Relevant content
asked 3 years ago
asked 3 years ago
asked 4 years ago
