5

I have hosted a site in two VM's and added it in Application Gateway back end pool. We have a form submit which will do DB update and a confirmation page will be shown.

If both the server is up. The changes are updated properly on DB and confirmation page is shown even if the Form Filled from VM1 and submitted to VM2.

Consider the below case. The user comes into the page from VM1 and filling the details. After the VM1 is unavailable. Now when the user submites the code. The page loads and shows 502 proxy error. But the DB update are properly done through VM2. But the confirmation page is not shown.

502 error

12
  • I think it is a default behavior. When the Probe for VM1 fails, and the user still connects to the VM1, Application Gateway kills the connection. Hence you see 502. Can you try configuring "Connection Draining" property in the HTTP settings and test the behavior? Jun 6, 2019 at 11:23
  • @msrini-MSIT I have enable the connection draining for all my HTTP setting and tested. Still i face the same problem. Also i tried with enabling and Disabling the Cookie Base Affinity Still the issue is not resolved. Jun 7, 2019 at 4:20
  • Can you share the access logs where you can see AppGW sending out 502? I would be interested to see the time the backend server took to the request AppGW forwarded. Jun 7, 2019 at 4:27
  • @msrini-MSIT. Please find the Access log below .{ "resourceId": "/****", "operationName": "ApplicationGatewayAccess", "time": "2019-06-07T05:12:42Z", "category": "ApplicationGatewayAccessLog", "properties": { "instanceId":"ApplicationGatewayRole_IN_0", "clientIP":"61.12.45.122", "clientPort":61831, "httpMethod":"GET", "requestUri":"/company/confirmation", "requestQuery":"*****", "httpStatus":502, "httpVersion":"HTTP/2.0", "receivedBytes":1107, "sentBytes":1636, "timeTaken":21257, "sslEnabled":"on", "host":"****", "originalHost":"****" } } Jun 7, 2019 at 8:44
  • 1
    @msrini-MSIT Actually its due to the timeout value is set. The server is kept active in the health probe for 4 minutes. So it request to the same server and showed server error. After reducing the time i couldn't reproduce the issue Jun 21, 2019 at 11:12

1 Answer 1

0

The issue was due to the incorrect timeout value set on Health Probe. When your server is down, the requests will be sent to the backend unhealthy server for 4 minutes as the timeout value is too long. Once the timeout value is reduced, the issue is resolved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.