Debug 502 Errors in Google Cloud Load Balancer

Posted on March 27, 2020 at 11:51 am

If your Google Load Balancer shows 502 errors read below:

First go to Logs Viewer:

https://console.cloud.google.com/logs/viewer

Then in the search filter editbox enter:

httpRequest.status:502

This will search all 502 errors in the selected Load Balancer.

Click on the specific line with the 502 error and expand “jsonPayload”:

jsonPayload: {
  @type: "type.googleapis.com/google.cloud.loadbalancing.type.LoadBalancerLogEntry"   
  statusDetails: "backend_timeout"   
}

So looks like the error is caused by a backend timeout:

statusDetails: "backend_timeout"

To increase the backend timeout settings:

https://cloud.google.com/load-balancing/docs/backend-service#timeout-setting

Then save settings and that’s all!

Receive updates via email

Other Posts

Updated Posts