How do I troubleshoot 503 (service unavailable) errors from my Application Load Balancer?
I get an HTTP 503 (Service unavailable) error when using an Application Load Balancer (ALB). How can I resolve this error?
"I get an HTTP 503 (Service unavailable) error when using an Application Load Balancer (ALB). How can I resolve this error?Short descriptionTo determine if the Application Load Balancer is generating the 503 errors, do one of the following:Access your CloudWatch metrics and locate a metric labeled HTTPCode_ELB_503_Count.Run this CURL command. If the response contains "503 Service Temporarily Unavailable," then the error is coming from the Application Load Balancer.Be sure to replace MY_URL with the URL used to access the Application Load Balancer:$ curl -IkL MY_URLCheck your Application Load Balancer access logs. Confirm that there is an elb_status_code = 503 in the logs.If you see 503 errors in any of these places, the error is generated by your Application Load Balancer. Use the following troubleshooting steps to resolve the error.ResolutionVerify that the target group has registered targetsVerify using the EC2 ConsoleAccess the Amazon EC2 console.On the navigation pane, under Load Balancing, choose Target Groups.Choose the name of the target group to open its details page.Choose the Targets tab.Check to see if there are targets listed. If they are listed, then they are registered.Verify using the AWS CLINote: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI.To verify targets using the AWS CLI, use the describe-target-health command.Register targetsIf you don't see any registered targets, register them through the console or through the AWS CLI.Verify that the target group is associated with an Auto Scaling Group (if you're using Auto Scaling)If your Target Group is part of an Auto Scaling Group, then confirm that the two are associated correctly. If they aren't, attach the groups.Verify using the EC2 console:Open the Amazon EC2 console.On the navigation pane, under Auto Scaling, choose Auto Scaling Groups.Choose the Auto Scaling group that you want to verify.Under Load balancing, confirm that the Target Group of the Application Load Balancer is associated with the Auto Scaling Group.Verify using the AWS CLIRun the describe-auto-scaling command. Be sure to replace MY-ASG with the name of your Auto Scaling group. Replace AWS-REGION with your specific AWS Region.$ aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name MY-ASG --region AWS-REGIONIn the command output, confirm that the target group is listed under TargetGroupARNs.Attach the target groupIf the target groups aren't attached to the Auto Scaling group, associate the groups through the console or through the CLI.Check target healthAfter you confirm that your targets are registered, confirm they are in a healthy state. For more information, seeHow do I troubleshoot and fix failing health checks for Application Load Balancers?Related informationDeregisterTargetsAttachLoadBalancerTargetGroupsFollow"