Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS fails to run ASP.NET Core site - HTTP Error 502.5

We have a Windows 2012 R2 machine. I had an existing ASP.NET Core site on it that had a working published ASP.NET Core site running.

However when I published to the site again today a month later after I made changes, I can't access the site anymore and get the following error in my browser

HTTP Error 502.5 - Process Failure

For more information visit: http://go.microsoft.com/fwlink/?LinkID=808681

If I log onto the server and click on the exe in my deployed directory it opens a command prompt and shows my site on port 5000. If I access the site on http://localhost:5000 it works perfectly so the problem is to do with IIS and not the site itself.

If I log onto the server I can see the following in Windows EventViewer

enter image description here

Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE/MySite' with physical root 'D:\Sites\MySite\' failed to start process with commandline '"%LAUNCHER_PATH%" %LAUNCHER_ARGS%', ErrorCode = '0x80070002 : 0.

When I visit the link in the browser error message it mentioned reinstalling the .net Core Hosting bundle which I did. However the error message in the browser is the same.

<?xml version="1.0" encoding="utf-8"?> <configuration>   <system.webServer>     <handlers>       <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />     </handlers>     <aspNetCore requestTimeout="02:00:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />   </system.webServer> </configuration> 

When I look at my app log folder a stdout file does get created for every time it tries to access this site but each time it is of size 0KB and empty contents.

Why does IIS refuse to work suddenly where it worked previous but the app works if I access the compiled exe directly?

like image 817
dev2go Avatar asked Jan 11 '17 12:01

dev2go


People also ask

What is HTTP Error 502.5 Process failure?

Causes for HTTP Error 502.5 – Process Failure In general, the 502.5 error occurs when the ASP.NET application is not running. However, from our expertise in managing server, our Windows Experts identify the common causes for the error as: Incorrect deployment and architecture. Missing .


1 Answers

Your problem is a bad web.config file:

<aspNetCore requestTimeout="02:00:00"       processPath="%LAUNCHER_PATH%"       arguments="%LAUNCHER_ARGS%"       stdoutLogEnabled="true"       stdoutLogFile=".\logs\stdout"       forwardWindowsAuthToken="false" /> 

The path %LAUNCHER_PATH% does not exist on your system, it is not even valid. It should be something like:

<aspNetCore requestTimeout="02:00:00"       processPath=".\yourAppName.exe"       arguments="somePossibleArgument"       stdoutLogEnabled="true"       stdoutLogFile=".\logs\stdout"       forwardWindowsAuthToken="false" /> 

Notice that the web.config file is completely ignored if the app is launched from the command line, that's why you do not receive the error.

like image 185
Camilo Terevinto Avatar answered Oct 15 '22 05:10

Camilo Terevinto