Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP 502 from one instance of an Azure Web App

We suddenly began experiencing HTTP 502 errors (The specified CGI application encountered an error and the server terminated the process) from one of the instances of our web app. I was able to determine this using Kudu's "Support" tab whereby you can drill down to metrics per instance.

After restarting w3wp for the instance everything continued successfully as normal. There were no problems with resource usage (CPU/RAM) and the odd thing is that the 502s were returning instantly. So, requests weren't timing out for the client.

What are the possible steps to investigate why this happened?

Our application logs wouldn't have anything and our web server logs only have the record of these 502 but with no further details.

like image 885
Dave New Avatar asked May 11 '17 10:05

Dave New


People also ask

What is Azure Application Gateway 502 error?

After configuring an application gateway, one of the errors that you may see is "Server Error: 502 - Web server received an invalid response while acting as a gateway or proxy server". This error may happen for the following main reasons: NSG, UDR, or Custom DNS is blocking access to backend pool members.

How do I check my Azure application gateway logs?

Enable logging through the Azure portalIn the Azure portal, find your resource and select Diagnostic settings. For Application Gateway, three logs are available: Access log. Performance log.


1 Answers

In our case it seems to have come down to port exhaustion on the app service plan. Read here for more details on the limitations for each of the plans available.

like image 177
Dave New Avatar answered Sep 18 '22 23:09

Dave New