Hi All I am facing issue "The specified CGI application encountered an error and the server terminated the process." after hosting it on Azure Web Sites. On Local it works fine. I have developed application on asp.net core 1.0 and deployed on Azure.
Is there any timeout issue or any thing missing when deployed code on azure ?
Please help me out regarding this issue.
Start here: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/troubleshoot. We're working on an Azure specific version, feel free to ask for details on https://github.com/aspnet/Docs/issues/4890. @Rick-Anderson is there a draft available?
If you can't figure it out after reviewing https://github.com/aspnet/Docs/pull/5180 , open a doc issue at https://github.com/aspnet/Docs/issues/new explaining where the doc doesn't help.
cc @guardrex
@ankurjasoria Ping me on Slack chat to talk about the new App Service topic if it doesn't help you resolve your problem. It's not live in the docs yet. It will merge shortly; however, you can read the topic at: https://github.com/guardrex/Docs/blob/488c4809b2dfddca2dbd4b03280e4034e5942a09/aspnetcore/host-and-deploy/azure-apps/troubleshoot.md
I have same issue using .net core 2.0. I redeploy app and it works fine but at one point i get the same problem all over again.
@rpkRED Did you ever resolve this issue? I am getting it on a service I've just hosted in Azure. It seems to recover occasionally though I am not sure how to reproduce it yet.
This post says to add UseIISIntegration on the WebHostBuilder. I'm going to try that to see if it stops the problem that I can't reproduce yet, does your solution include UseIISIntegration?
@DinoSourcesRex Did UseIIsIntegrationsolved it ?
I also monitor CPU and when this is encountered I see a spike on CPU usage up to 100% and I think it might be related to that. However I don't know if it is cause or effect.
@alexiordan I have yet to see it occur again, I did try a bunch of other things at the same time (such as turning always_on to true) so I am not sure if it was one of those things.
I am facing same issue on production server but works fine in local.
ASP.Net Core 2.1.2 based application in Azure App Service I am getting this error intermittently.
The following is my program.cs code
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.CaptureStartupErrors(true)
.UseSetting("detailedErrors", "true")
.UseKestrel()
.ConfigureServices(services => services.AddAutofac())
.UseIISIntegration()
.UseStartup
@somsekhar have you set the webapp to always_on? Adding IISIntegration and always_on are the only two things I recall doing to resolve this error, granted this was on asp.net core 2.0.#
@DinoSourcesRex Thanks for the update.
Are you talking about setting appsetting.json copy to output directory
Can you please tell me where to add always_on.
@somsekhar If you go to your azure app service, under the Application Settings blade (blade is just the word used to describe the pages you are on - that's a poor definition but it's the best I can give you) you will find a toggle called "Always on" - it is set to off by default. Flick that to on.
@DinoSourcesRx I checked the settings but it is already set to On under Application Settings/General Settings.
@somsekhar Sorry then, I'm afraid we've exhausted everything I did then.
All I did was turn on "always on" in app settings.
One thing to check would be that your web.config file is correct, since Kestrel uses IIS as a reverse proxy by default.
Checkout this page for help on that.
If that doesn't work I'm afraid I'm out of options, but if / when you do fix it I'm interested in knowing how.
Hello, I'm facing a similar issue with ASP.NET Core 2.0.
Please let me know if you were able to resolve this issue. It would definitely help! Thanks.
If the real solution for that is turn ALWAYS ON on, why not have this as default in the creation of web apps?
No more action is planned on this issue so I'm closing this. Folks can check the troubleshooting guide linked above for similar issues.
FYI, we ran into this issue today with the CGI application error.
Azure dev ops or dotnet publish seems to be doing XML transforms for us on our web.config files, and we ended up having two entries in the web.config for ASPNETCORE_ENVIRONMENT.
The ultimate source for discovering this was here
Warning
Environment variables set in this section conflict with system environment variables set with the same name. If an environment variable is set in both the web.config file and at the system level in Windows, the value from the web.config file becomes appended to the system environment variable value (for example, ASPNETCORE_ENVIRONMENT: Development;Development), which prevents the app from starting.
We had the following in web.Release.config, and it was normally transformed by Octopus Deploy when deploying.
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<aspNetCore>
<environmentVariables xdt:Transform="Insert">
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="#{HostingEnvironment}" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>
Somewhere in our Azure Dev Ops build, the transform was already taking place, but, the transform file was still in the artifacts list which was then placed into our Nuget package. That Nuget package was then shipped to Octopus Deploy, which did another transform. Because we used Insert for the transform command, a second copy of the environment variable was inserted into the web.config file.
This is a recent change. This project is still on dotnet core 1.1, I believe, and we just had a successful build and deploy on 1/30/2019. A rebuild of the exact same code base also caused this problem, and it doesn't appear to be an Octopus change.
Mates, I was able to solve this issue by removing forwardWindowsAuthToken from the web.config file under wwwroot. Please do the following steps.
Step 1)Navigate to src/ProjectName/wwwroot
Step 2)Open the web.config
Step 3)In the httpPlatformremove the forwardWindowsAuthToken="true/false" property
Step 4)Redeploy and mine worked fine.
Most helpful comment
Mates, I was able to solve this issue by removing forwardWindowsAuthToken from the web.config file under wwwroot. Please do the following steps.
Step 1)Navigate to src/ProjectName/wwwroot
Step 2)Open the web.config
Step 3)In the httpPlatformremove the forwardWindowsAuthToken="true/false" property
Step 4)Redeploy and mine worked fine.