title: 502 Server Error sometime on Google Compute Engine
body: <p>I set up a server on Google Compute Engine with Apache server on Ubuntu 16.04.4 LTS. It's protected with IAP.</p>
  
  <p>It was fine all along for about 6 months but now some of the users encounter 502 Server Error. </p>
  
  <p>I already checked the following links</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/41305122/some-502-errors-in-gcp-http-load-balancing">Some 502 errors in GCP HTTP Load Balancing</a>  [Changed the Apache KeepAliveTimeout to 620]</li>
  <li><a href="https://stackoverflow.com/questions/43224170/502-response-coming-from-errors-in-google-cloud-loadbalancer">502 response coming from errors in Google Cloud LoadBalancer</a> [Removed ajax requests]</li>
  </ul>
  
  <p>But the problem is still there. </p>
  
  <p>Here is the error message from one of the log. </p>
  
  <pre><code>{
       httpRequest: {…}  
       insertId:  "170sg34g5fmld90"  
       jsonPayload: {
        @type:  "type.googleapis.com/google.cloud.loadbalancing.type.LoadBalancerLogEntry"   
        statusDetails:  "failed_to_pick_backend"   
       }
       logName:  "projects/sggc-web01/logs/requests"  
       receiveTimestamp:  "2018-03-14T07:21:55.807802906Z"  
       resource: {…}  
       severity:  "WARNING"  
       spanId:  "44a49bf1b3893412"  
       timestamp:  "2018-03-14T07:21:53.048717425Z"  
       trace:  "projects/sggc-web01/traces/f35119d8571f20df670b0d53ab6b3210"  
      }
  </code></pre>
  
  <p>Please help me to trace and fix the issue. Thank you!</p>