ASP.NET Core deployed on IIS returns 502 error for long running request


Mustafa Shujaie

I have an ASP.NET Core 2 web application hosted on IIS 10 on Windows Server 2012 without any load balancing and special configuration. For some MVC operations that take too long, we get a 502 HTTP error.

enter image description here

I was shocked after seeing this error because I didn't configure any proxy server etc. Then I remembered ASP.NET Core running on Kestrel. So I came to the conclusion that IIS is here acting as a proxy server and forwarding the request to Kestrel. So I think it has something to do with the timeout configuration, as the rest of the application is working fine. I've searched SO for similar questions, but have had no luck finding a solution.

Oscar prize

By default, the ASP.NET Core request timeout is 2 minutes, you can change it in the settings file via requestTimeout. see more here

The optional timepan attribute of requestTimeout.

Specifies the duration that the ASP.NET Core module will wait for a response from a process listening on %ASPNETCORE_PORT%.

The default value is "00:02:00".

requestTimeout must only be specified in whole minutes, otherwise it defaults to 2 minutes.

Related


ASP.NET .Net Core IIS returns 502 when request from Extranet

Tao Zhu I successfully published an asp.net core (full framework) site to a server running Windows 2008 R2 and IIS 7. When I try to access it from PC it always returns 502 Bad GateWay like this: Extranet visit but when I access it from server it works fine. I

Error running ASP Core on IIS

About Bikil Ok, I created an ASP Core 2.0.5 website and put it on an IIS server (Windows Server 2016), but everytime I try to run it, I get " HTTP Error 502.5 - Process Failed " In the Windows event, I get the following error: Application 'MACHINE/WEBROOT/APPH

Error running ASP Core on IIS

About Bikil Ok, I created an ASP Core 2.0.5 website and put it on an IIS server (Windows Server 2016), but everytime I try to run it, I get " HTTP Error 502.5 - Process Failed " In the Windows event, I get the following error: Application 'MACHINE/WEBROOT/APPH

Error running ASP Core on IIS

About Bikil Ok, I created an ASP Core 2.0.5 website and put it on an IIS server (Windows Server 2016), but everytime I try to run it, I get " HTTP Error 502.5 - Process Failed " In the Windows event, I get the following error: Application 'MACHINE/WEBROOT/APPH

Error running ASP Core on IIS

About Bikil Ok, I created an ASP Core 2.0.5 website and put it on an IIS server (Windows Server 2016), but everytime I try to run it, I get " HTTP Error 502.5 - Process Failed " In the Windows event, I get the following error: Application 'MACHINE/WEBROOT/APPH

502 action result after long running asp.net controller

David I have the following controller ActionResult where prodManager.ProcessFile() is called. This takes 2 to 3 minutes, during which I will get a 502 error in the browser due to IIS timeouts. It's probably not a good idea to increase the time it takes for IIS