ASP.Net 1.0 Core app - HTTP Error 502.5 - Process Failure in Prod web server but works in Preprod
We have an ASP.NET Core 1.0 application which has been successfully deployed and running on our pre-prod server for months. Today we tried deploying the website to our production server using this article as a guideline: https://docs.asp.net/en/latest/publishing/iis.html
Bottom line is we’ve tried a bunch of things, but can't get past this error:
HTTP Error 502.5 - Process Failure
Common causes of this issue:
* The application process failed to start
* The application process started but then stopped
* The application process started but failed to listen on the configured port
How do you go about debugging a 502.5 error, to get to the actual cause of the failure?
The app's log files are getting created, but unfortunately they are empty (0 bytes). The webserver's Event Viewer contains this entry: Process was created with commandline 'D:\Applications\OurAppName\UserInterface.exe' but failed to get the status, errorCode = 0x80070005
Any help would be very much appreciated!
Just to be sure we're on the same page, have you gone through the troubleshooting steps for that error, which you can find in the same page you linked?
Also, 0x80070005 is an access denied error. Could your app be trying to access a resource it does not have permission to in your production server?
If it is access denied error, how can we find the actual issue? My stdlogs text files are created in the physical directory of the website but are empty?
I am not sure if empty log files and "HTTP Error 502.5 - Process Failure" are failing due to the same reason.
System is able to create log files, so i am not sure if its a permission issue
Based on the troubleshooting steps, none of the error matches our scenario. We are running out of ideas on finding the root cause.
Any help would be very much appreciated!
Based on the troubleshooting steps, none of the error matches our scenario.
That's correct. I didn't provide for access denied. We might be doing that depending on what we find out here.
Is your AppPool identity running under ApplicationPoolIdentity?
Can you provide your project.json, web.config, Startup class, and Program class just so we can look things over? Usually a repo works best. You can strip out all of the unimportant bits and mask sensitive values.
We are running AppPool identity in Integrated mode under "Network service" . We also tried switching to ApplicationPoolIdentity but no luck.
Since stdlog files are blank, we are not sure which resource is causing Access denied error. I have attached all the requested file.
Web.config.txt Program.cs.txt Project.json.txt Startup.cs.txt
Thanks,
You should be able to drop the "imports" from your tools at this point.
You can drop the commands section. That's gone now.
Also, your tools dep versions should be 1.0.0-preview2-final.
Since stdlog files are blank
The web.config you provided is your unpublished web.config. After making the above changes (particularly the the change to the Microsoft.AspNetCore.Server.IISIntegration.Tools version), restore, and publish, could you show your published web.config?
[EDIT] and when you test after these updates, be sure to set stdoutLogEnabled="true" in the published web.config prior to firing up the app. The publish-iis tool will default it to false, so you'll have to manually set it after running dotnet publish.
Today updated to September Release 1.0.1 and I'm having same issue when I publish in 64bit Windows Server Core 2012 R2 v1.2.0 running IIS 8.5. Log is telling details like this:
2016-09-14T18:40:53.000Z Error 0:(0) IIS AspNetCore Module - Failed to start process with commandline '"dotnet" .\MySolution.MyApi.dll', ErrorCode = '0x80004005'. 2016-09-14T18:40:53.000Z Warning 0:(0) IIS AspNetCore Module - Warning: Could not create stdoutLogFile ?\C:\inetpub\AspNetCoreWebApps\app\logs\stdout_2428_2016914184053.log, ErrorCode = -2147024893.
I was experiencing the same issue, and found that I had to explicitly set the path to dotnet.exe in the web.config for the application to work properly.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at https://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\CustomersApp.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>
From the docs (https://docs.asp.net/en/latest/publishing/iis.html#deploy-the-application):
- For a portable application, dotnet.exe might not be accessible via the PATH settings. Confirm that C:\Program Files\dotnet\ exists in the System PATH settings.
- For a portable application, dotnet.exe might not be accessible for the user identity of the Application Pool. Confirm that the AppPool user identity has access to the C:\Program Files\dotnet directory.
Also, I'm not sure if this is best practice or even needed, but I gave NETWORK SERVICE read permissions to the dotnet directory and the application's published directory, then set my ApplicationPool to use NETWORK SERVICE as the user identity.
Hi Guardrex,
I would like to post some updates/questions about this issue.
We had this issue in our Prod web server (Win server 2008 R2, IIS 7). We couldn't resolve this issue after trying different settings.
Work around: When we deployed the same code to our new web server (Win server 2012, IIS 8), this issue went away.
PS: Deployment went fine in our pre prod web servers (Win server 2008 R2, IIS 7) with .net core version. that was released in June.
Same Issue with Latest .Net core :
After upgrading our solution to latest .Net core ( All Nuget packages are upgraded to 1.0.0) including the Project.Json file(We copied from a new .net core app to ensure it has proper tool/dependency section), deployment failed even in our Preprod server (Win server 2008 R2, IIS 7)
Root Cause
After analysis and going through various forum, we figured out the "%LAUNCHER_PATH%" variable was never replaced in the published web.config.
Work Around:
We replaced "%LAUNCHER_PATH%" variable with our actual executable ( ".\UserInterface.exe") in the web server and everything started working.
Attachments: Project.json.txt Published_Web.config.txt
Questions:
- We were wondering why "%LAUNCHER_PATH%" variable is not being replaced after publishing with the latest .Net core library? (This was not the issue when we used earlier version of .Net core)
- To my understanding, the minimum requirement for .Net core app deployment is Win 2008 with IIS 7 Do we have any known compatibility issue?
- Anything to do with Microsoft.AspNetCore.Server.IISIntegration.Tools library version in tools or dependency section?
Thanks, Valliappan
@valcs007 The publish iis tooling (Microsoft.AspNetCore.Server.IISIntegration.Tools) should have taken care of updating the processPath. Your tooling reference and postpublish script entries are correct. @moozzyk can comment further on why it might not have been running.
RE: Minimum requirement
2008R2 is IIS 7.5, which is prob what you meant, but yes, that is a supported OS version.
Some had difficulty because the VC++ redist wasn't installed; but currently, the ANCM Hosting bundle installer installs it now when the ANCM is installed (as long as the box has an active Internet connection). Unfortunately, I didn't have the impression that everyone was aware that the installer failed to install it when the box didn't have an Internet connection ... the error was buried in the ANCM Hosting bundle installer log, so it wasn't obvious in several cases that something went wrong. A manual install of the VC++ redist fixes that problem when it occurs.
There are no known compatibility issues. Every case I saw of trouble getting .NET Core apps running on any flavor of WS from 2008R2 all the way to Nano were eventually traced to a bug (less likely; and known bugs have been addressed AFAIK) or a configuration issue (much more likely).
The thornier issues I've witnessed had to do with permissions. For example, in one case, a buried and long forgotten deny rule prevented dotnet.exe from running. If you can run dotnet.exe from the command line when you login with your admin account but the identity of the IIS AppPool can't seem to fire it up and you see a permission denied error, then you'll find yourself troubleshooting a permissions issue.
If you upgraded the packages using VS UI I know there was/is a bug where the VS NuGet UI will remove "tools" section from the project.json during the upgrade and move them to dependencies. As a result the tools won't work. (https://github.com/NuGet/Home/issues/3008)
@GuardRex - Sorry, i meant IIS 7.5. My prod server issue might be a permission issue? Any idea how to debug permission issue?
The current issue in my pre prod server with nww .Net core library seems to be not a permission issue.
Generally where does the publish tool get the process path from?
@moozzyk - I am aware of the bug you mentioned but in my case, the project.json seems to be intact,
Anything else you need to reproduce the issue?
My prod server issue might be a permission issue?
Well, I was just using that as an example of a problem that can be more difficult to troubleshoot.
Did you run down the list of common errors at https://docs.asp.net/en/latest/publishing/iis.html#common-errors ... do any of the behaviors (browser, Application log, ANCM log) match?
@valcs007 I'm currently reviewing issues for updates to the Publish to IIS doc. Did you ever determine the cause of (a) publish-iis tooling not running on publish, and (b) possible permission prob (0x80070005) when the app was trying to access some resource on startup?
I had a same issue . I changed application pool identity to network service account . Then I explicitly set the path to dotnet.exe in the web.config for the application to work properly as @danielyewright said in his comment . It works after set the path.
Thanks
Can asp.net Core app run on Windows server 2008 R2 with IIS 7 ?
After hosting on WS 2008 R2 with IIS7, Handler Mapping in IIS7 iteself throwin error ..


Finally I feel, Asp.net core is not compatiable with WS 2008 R2 with IIS7
@balarvs2002 Can you post your published web.config here so we can take a look?
posted my webconfig in my previous comments
Seems ok. You installed the hosting bundle on the server and restarted?
https://aka.ms/dotnetcore_windowshosting_1_1_0
If you only want to run the installer to install the ASP.NET Core Module, run the installer from an Administrator command prompt with ...
DotNetCore.1.1.0-WindowsHosting.exe OPT_INSTALL_LTS_REDIST=0 OPT_INSTALL_FTS_REDIST=0
and it will only install the module. If you run the full installer, you get the shared framework and runtime along with the module.