aspnet / IISIntegration

[Archived] ASP.NET Core IIS integration. Project has moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
149 stars 59 forks source link

"HTTP Error 502.5 - Process Failure" asp.net core error in Azure #252

Closed ardacetinkaya closed 8 years ago

ardacetinkaya commented 8 years ago

Hi; I just deployed my asp.net core app to azure which I developed in mac os x. It is successfully build and run on my local environment.

But when I browse the app on Azure site, I got the following error.

screen shot 2016-08-17 at 3 58 31 pm

I checked the link in error https://docs.asp.net/en/latest/publishing/iis.html#common-errors for some info but could not link with my issue.

Also when I check Azure logs, in Application Logs, I have

HTTP Error 502.5 - Bad Gateway The specified CGI application encountered an error and the server terminated the process. Most likely causes: The CGI application did not return a valid set of HTTP errors.A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.

Also some additional info in Application Logs

Requested URL--http://maping:80/ (this line seemed interesting to me) Physical Path--D:\home\site\wwwroot

My web.config is like below;

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

And finally my project.json file;

`
{
  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0"
  },
  "frameworks": {
    "netcoreapp1.0": {}
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "web.config"
    ]
  },
}`

Any idea?

I have also below properties for project.json

 "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },
  "scripts": {
    "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
  }
firemanwayne commented 7 years ago

@damccull Your solution end a painful day and a half stent of moving to Https for me. His solution resolved my 502.5 error after publishing to Azure with .netcore2.0

gcsuk commented 7 years ago

I solved this issue by excluding web.config from my project. This means that when publishing, it creates default files as VS thinks there is no web.config, so Azure is happy, whilst the web.config is still on disk and available to local IIS.

tmmueller commented 6 years ago

@razzemans Thank you! Removing the Application Insights extension worked for me as well. I removed it in the Azure portal rather than Kudu.

yosbeleg89 commented 6 years ago

I have the same issue after upgrading to AspNetCore 2.0.6, I removed the wwwroot folder, excluded the web.config and still the same in Azure.

guardrex commented 6 years ago

@yosbeleg89 Did you run down the steps in the troubleshooting topic? https://docs.microsoft.com/aspnet/core/host-and-deploy/azure-apps/troubleshoot

That's a fairly new topic, and I'd be happy to hear your feedback on if the steps outlined in the topic lead to uncovering the problem with your deployment.

Tratcher commented 6 years ago

The 2.0.6 deployment to Azure hasn't finished yet. See https://github.com/Azure/app-service-announcements/issues/92

guardrex commented 6 years ago

I wonder if it makes sense to deploy a new release to Azure first, then announce that the new release is available.

davidebbo commented 6 years ago

@guardrex unfortunately that's not really feasible. There is a bit of a chicken and egg problem, with things not fully working in Azure until the symbols are published by the Core team, and that doesn't happen until it's announced.

Deployment to App Service should normally be complete in a couple of days. You can test it now in West US 2 if you'd like.

That being said, I'm not sure that relates to the issue in this thread.