Last_Node_Standing
Last_Node_Standing

Reputation: 429

Load balancer 503 Service Temporarily Unavailable

I set up a service with 4 tasks on ECS fargate. Each task's container is running on port 5000. The server has an endpoint /api/auth/test I set up just to make sure everything's working correctly. When I put the task's public IP in the browser (ipAddress:5000/api/auth/test) it works. When I try to hit the service through the load balancer, I get 503 Service Temporarily Unavailable. The URL I used was http://**************5.us-east-1.elb.amazonaws.com/api/auth/test (/api/auth/test is what I'm using for health checks, so very strange).

Load balancer listener is set up on port 80 for http requests.

I've checked the registered target group and all my tasks are healthy. Load balancer security groups allow connection from anywhere. Service security groups allow connection from anywhere.

What are some debugging strategies I can use here? Am I just accessing the url wrong?

Upvotes: 1

Views: 2396

Answers (1)

Last_Node_Standing
Last_Node_Standing

Reputation: 429

Here's the solution I found. I had TWO target groups set up. All my requests were being forwarded to the incorrect target group. For anyone else experiencing this issue, check EC2 -> load balancer and make sure the listener rules are correctly set.

Upvotes: 1

Related Questions