Compute Engine HTTP Load Balancing 502 error
Asked Answered
C

3

22

We're having significant issues with our http load balancer from certain IPs only.

I've seen a few other posts here about this. We've made sure the firewall is ok, I've even deleted and recreated the forwarding rules. Which is blasted annoying since the IP changes.

Still no joy. The problem only affects certain IP addresses - and if I post the same data to the IP of one of the servers, I have no problem.

<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>

EDIT

We use cloudflare - usually this is actually disabled for this host however, I have just re-enabled it and now traffic is accepted again. Presumably since the traffic originates from a CF ip.

Campy answered 13/9, 2015 at 17:55 Comment(9)
What's the point in Google saying support is available on SO, when no-one replies. Would be more open to say "No support". Rubbish.Campy
we have seen the same issue if I use curl to upload bulk data to my GCE LB fronted api. It only works if I use curl with curl -X POST -H "Expect:" . i.e. explicitly setting the Expected header to blank.Succuss
I'm seeing a lot of unexplained 502 errors with my HTTP load balancer atm too. It's currently causing a site outage for me.Vanny
@splaktar Ours our fine although this weekend we started getting 50x errors from other calls from BQ. Probably unrelated but generally sucky nevertheless. Hope you get sortedCampy
@Campy thank you for the information. We did not change any configuration, but just started getting 502 errors at 5am and restarting has not helped. There are no logs or errors that I've been able to find.Vanny
No, that's the hard part. I found this site a little useful once though googlecloudplatform.blogspot.co.uk/2015/07/…Campy
@Vanny spoke too soon. All our instances were removed from the load balancers this morning... arg.Campy
Thanks a ton for that link. It is exactly what I was looking for. Our issue from yesterday was just a minor routing issue but tracking it down was harder than it should have been.Vanny
Good news :) Shame, ours is not so smooth. They keep removing our instances for no reason. AGggggasdfgggCampy
P
8

A 502 error is a "bad gateway" response. Have you checked the health check status of your instances at the time that the 502 errors are occurring?

You haven't mentioned whether you're running backends in more than one region. It's possible that your backends in one region are all being marked unhealthy at once, which is causing your failures.

Are your backend services using the default HTTP health check, or have you customized it? If the former, you might consider defining a more lenient health check for your backends (though this may mask actual application server failures). The default is to check backends every 5s on "/" with a 5s timeout, and require 2 consecutive failures or successes to change the state.

Petta answered 24/1, 2016 at 17:24 Comment(2)
I wish this is my problem. My health checks are all reporting 100% healthy.Aaronson
Cheers! I had set up a health check to a route that didn't exist yetAdversary
N
0

I've seen similar 502 errors when the backend service is too busy to handle the incoming traffic. Try adding more instances and it should go away.

However, I see this as a bandaid fix as this does not really solve the issue

Necklace answered 10/5, 2016 at 3:43 Comment(1)
How to confirm this?Aaronson
A
0

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?

Assyrian answered 5/7, 2020 at 18:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.