Server Error: 502 - Web server received an invalid response while acting as a gateway or proxy server.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.


The problem was raised randomly.
I have a real shared host with 2 difference websites and domains.
My own design was right but another with Nopcommerce has this problem.
I know that source of the problem is in Nopcommerce but what is it , I don't know !!!!!!



Find more about nopCommerce here
5 years ago
I have the same issue - using NopCommerce 4.0 and a nop-templates Urban theme.
Azure support are looking at it for me, as it occurred after a restart that was initiated by an Azure maintenance operation.
They have found so far this;

Our Findings:

The Microsoft Azure Team has investigated the issue you reported and we have identified that the incident started to happen after a dependency that the Azure Web App service takes on Azure Storage.

The application site content is hosted within Web App Azure App Services are backed by Azure Storage in a durable manner. The application accesses the site contents as file shares (this model maximizes application compatibility).

The file shares in Azure App Services are served by a collection of file servers, which mount durable cloud-based storage volumes. This design allows storage volumes to move between file servers when/if the file servers should go through a scheduled maintenance or any unplanned issues that would affect the fileserver.  When such a movement occurs there is an expected mounting and un-mounting of the volumes on some file servers.

When mounting and un-mounting of the volumes on some file servers; this could lead to applications to restart and occasional storage availability loss.

One such occurrence is a transient storage/network availability blip or file server maintenance (rebooting/OS patching) or even crashes. This scenario can cause the storage volume to fail over to new file server and trigger an application restart.

When the swap is made on the sites, by default the apps are going to restart and this caused the app to communicate with the appropriate storage and get the app in production again. But we have observed that this is not done with ASP.Net Core and we have identified that issue is related to an interaction between the site preload functionality and the Asp.Net core module in the IIS pipeline. The Asp.Net core team has assisted us in troubleshooting the issue.

They have identified some code changes that will avoid this situation and are working towards a planned update for this module.
5 years ago
Any update on this issue ?

We are having same issue on our site but we are not using azure. We are having dedicated hosting.

Thanks,
Jatin
5 years ago
Hello,

We had same problem and here are details:

- A2 Shared hosting
- one Nop with two stores (each store has completely different url)
- one store working fine
- another store returns the error

Clearing cookies in browser for the domain - solves the problem

so something wrong with cookies

Thank you
4 years ago
Hello,

If other guys has similar issue below is the solutions that worked for us.

We are getting this error when the request takes more time to process and server is not responding in 2 minutes of the default timeout period so its just matter of increasing request time out.

You just need to add attribute requestTimeout = "00:10:00" in aspNetCore element in web.config.

This will set request timeout for 10 minutes and it worked for me.

I hope it helps other members who get similar errors.

Thanks
Vipul
3 years ago
I have an Apache server as a proxy server, and NopCommerce running behind it. The config file  has this value:  requestTimeout="23:00:00"  and the system is still impossible to install, the installation process fails with that 502 error. Any ideas?
3 years ago
[email protected] wrote:
The config file  has this value:  requestTimeout="23:00:00"


That's in the web DOT config, but Apache has its own config file.  I believe default timeout is 120 seconds, which could definitely be exceeded during installation.  Some hints here: https://stackoverflow.com/questions/169453/bad-gateway-502-error-with-apache-mod-proxy-and-tomcat
3 years ago
Thank you so much, this did the magic:
in the vhost file, I've set the timeouts.

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5030/ timeout=600
ProxyPassReverse / http://127.0.0.1:5030/ timeout=600

Thanks again!
3 years ago
MickeyP wrote:
The Asp.Net core team has assisted us in troubleshooting the issue.
They have identified some code changes that will avoid this situation and are working towards a planned update for this module.[/i]

Hi Mickey,
Is it worked? If yes then can you share what is exact solution for this in this thread. This would be helpful for the community.

Thanks
2 years ago
This is not the solution - the problem appeared on our side today out of a sudden and we cannot get it fixed. To Upgrade 4.0 to 4.4 is not a solution as this will take weeks and we have a running business and now the sales drop rappidly due to site errors.

The provider upgraded framework .NetCore2.1/3.1/5.0 what cannot influence our site as 4.0 uses .NetCore 2.2  - also the timeout is set to 23:00.

Any other solution would be appreciated as we are loosing money every minute :(.

BTW we are hosting on IIS.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.