Error: Server Error The server encountered a temporary error and could not complete your request. Please try again in 30 seconds.(GCP)
Asked Answered
B

5

18

I've configured a HTTP(S) Load balancer as per the documentation on https://cloud.google.com/compute/docs/load-balancing/http/

When I try to access the site via the Public IP address associated with the Load balancer. I'm getting a 502 response with the message:

Error: Server Error

The server encountered a temporary error and could not complete your request.

Please try again in 30 seconds.

I believe this is coming from the load balancer.

Anyone have any insight into what might be going on, what more I should be looking at?

Bagpipes answered 5/7, 2020 at 18:38 Comment(0)
E
7

Have a look at the documentation Troubleshooting HTTP(S) Load Balancing section Unexplained 502 errors:

If 502 errors persist longer than a few minutes after you complete the load balancer configuration, it's likely that either:

To verify that health check traffic reaches your backend VMs, enable health check logging and search for successful log entries.

To create an ingress rule that allows traffic from the Google Cloud health checking systems (130.211.0.0/22 and 35.191.0.0/16) you can use Cloud Console or this command:

gcloud compute firewall-rules create fw-allow-health-check \
    --network=default \
    --action=allow \
    --direction=ingress \
    --source-ranges=130.211.0.0/22,35.191.0.0/16 \
    --target-tags=allow-health-check \
    --rules=tcp

In this command target tag allow-health-check used to identify VMs.

Epicurean answered 6/7, 2020 at 9:29 Comment(0)
P
5

I had the same problem. After a day of searching, it was a health checker problem. The health test was on TCP, I changed it to HTTP, the problem was solved.

Puff answered 5/11, 2021 at 21:33 Comment(0)
R
0

Could it be that the load balancer depends on you using the URL and not an IP address?

There are a couple of reasons that might be the case.

  1. The URL points to the load balancer and the load balancer has a list of server IP addresses that service that URL; then it picks a server and forwards the request. To do that, it must receive the oritinal URL because the load balancer may be serving multiple sets of servers.
  2. If the IP address points to the load balancer, it won't know which set of servers to choose from. If the IP address points to a server, the load balancer will be bypassed.

That's as much as I can think of... Jam

Rootstock answered 5/7, 2020 at 18:55 Comment(0)
I
0

I had the same issue with my ingress. Found out that it was related to the health check issue mentioned in the answers.

By default, GKE would create the health check endpoints for the / (root) paths. If your service resides in a subpath (e.g. /pingpong) then the health check endpoint was not created.

I have edited the / root path to /pingpong, the subpath which I needed to expose via the Ingress in the corresponding service.

Access the health checks via this URL. https://console.cloud.google.com/compute/healthChecks

enter image description here

Illyricum answered 13/1 at 17:29 Comment(0)
P
0

Check your billing at https://console.cloud.google.com/ Might as well be a billing issue.

Piemonte answered 14/6 at 4:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.