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%"
  }
Tratcher commented 8 years ago

Check your event logs in D:\home\Logfiles\EventLog.xml RE: https://blogs.msdn.microsoft.com/puneetgupta/2014/09/24/azure-website-siteextension-to-view-eventlogs/

muratg commented 8 years ago

@ardacetinkaya Can you also share the web.config file in your publish path? publish-iis modifies that file (or is supposed to modify it)

ardacetinkaya commented 8 years ago

@muratg I quess I can close this issue,after some check I found the problem which is related with my configuration.

iwasdavid commented 8 years ago

@ardacetinkaya what was the issue with your configuration? I'm having the same problem.

ZombiesWithCoffee commented 8 years ago

I upgraded to asp.net core 1.0.1 today and this started appearing for me.

I'd assume that it might have something to do with the project.json file. I wonder if we need to add a new line to the 'runtimes' section.

"runtimes": {
    "win10-x64": {}
},
ardacetinkaya commented 8 years ago

@iwasdavid my problem is about application path that I do the deployment. There was wrong binaries.

@ZombiesWithCoffee I am not sure but .NET Core in Azure might be still 1.0.0

muratg commented 8 years ago

@ZombiesWithCoffee if @ardacetinkaya's comment doesn't help, please share your web.config (in the publish path).

ZombiesWithCoffee commented 8 years ago

Will do muratg,

I've been posting to my Azure website nearly daily with updates without any issue. Once I upgraded to 1.0.1 this morning, I now only get HTTP Error 502.5 - Process Failure. Uninstalling only made things worse.

web.config

`<?xml version="1.0" encoding="utf-8"?>

`

project.json `{ "dependencies": { "Microsoft.ApplicationInsights.AspNetCore": "1.0.0", "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", "Microsoft.AspNetCore.Diagnostics": "1.0.0", "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0", "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", "Microsoft.AspNetCore.Razor.Tools": { "version": "1.0.0-preview2-final", "type": "build" }, "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", "Microsoft.AspNetCore.StaticFiles": "1.0.0", "Microsoft.EntityFrameworkCore.Tools": { "version": "1.0.0-preview2-final", "type": "build" }, "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", "Microsoft.Extensions.Configuration.Json": "1.0.0", "Microsoft.Extensions.Configuration.UserSecrets": "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", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { "version": "1.0.0-preview2-final", "type": "build" }, "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { "version": "1.0.0-preview2-final", "type": "build" }, "Microsoft.AspNetCore.Session": "1.0.0", "LinqKit.Microsoft.EntityFrameworkCore": "1.0.5", "Microsoft.AspNetCore.Mvc": "1.0.1", "Microsoft.AspNetCore.Server.Kestrel": "1.0.1", "Microsoft.EntityFrameworkCore.SqlServer": "1.0.1", "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.1", "Microsoft.NETCore.App": "1.0.1" },

"tools": {
    "BundlerMinifier.Core": "2.2.281",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
    "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
        "version": "1.0.0-preview2-final",
        "imports": [
            "portable-net45+win8"
        ]
    }
},

"frameworks": {
    "netcoreapp1.0": {
        "imports": [
            "dotnet5.6",
            "portable-net45+win8"
        ]
    }
},

"buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
},

"runtimeOptions": {
    "configProperties": {
        "System.GC.Server": true
    }
},

"publishOptions": {
    "include": [
        "wwwroot",
        "Views",
        "Areas/**/Views",
        "appsettings.json",
        "web.config"
    ]
},

"runtimes": {
    "win10-x64": {}
},

"scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}

} `

moozzyk commented 8 years ago

Either you showed web.config before publishing or publish-iis failed (should print an error). These: processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" should be replaced with the actual values.

ZombiesWithCoffee commented 8 years ago

You're right. I showed the 'before' web.config - I was sitting here editing my post at least 20 times to get the formatting right.

Here is the post process web.config

      <?xml version="1.0" encoding="utf-8"?>
      <configuration>
        <system.webServer>
          <handlers>
            <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
          </handlers>
          <aspNetCore processPath=".\SafeInvestigation.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" />
        </system.webServer>
      </configuration>
      <!--ProjectGuid: 216acf61-cc9a-41b1-a22a-1823cf540601-->
moozzyk commented 8 years ago

This config looks good. Check the Azure equivalent of event log. Also, enable std out logging (by flipping stdoutLogEnabled to true and check the contents of the stoud file. You should get some details as to what is happening.

ZombiesWithCoffee commented 8 years ago

Excellent suggestion on the stdoutLogEnabled.

I'm finally seeing something.

Apparently, I'm now missing a DLL named 'sni.dll'?

     fail: Microsoft.EntityFrameworkCore.Query.Internal.SqlServerQueryCompilationContextFactory[1]
     An exception occurred in the database while iterating the results of a query.
  System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.TdsParser' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SNILoadHandle' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'sni.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
     at System.Data.SqlClient.SNINativeMethodWrapper.SNIInitialize(IntPtr pmo)
moozzyk commented 8 years ago

I wonder if it is a bitness issue. @divega will know more.

muratg commented 8 years ago

Yeah I suspect @moozzyk is correct. Azure Websites do not support 64 bit apps currently. I recommend trying out 32 bits

ZombiesWithCoffee commented 8 years ago

Err, I've been posting my site on Azure since asp.net core went live. Why does an upgrade to 1.0.1 break it?

And sadly, removing 1.0.1 and putting project.json back doesn't fix it either. My site is now broken.

And this doesn't help

   "runtimes": {
       "win10-x64": {},
       "win10-x86": {}
   },
ZombiesWithCoffee commented 8 years ago

So @moozzyk or @muratg, does anyone have any suggestions on how to get my website back up and running again? This version 1.0.1 is an absolute development killer.

moozzyk commented 8 years ago

/cc @bricelam

divega commented 8 years ago

@saurabh500 see https://github.com/aspnet/IISIntegration/issues/252#issuecomment-247686538. Any changes in SqlClient in 1.0.1 that could cause issues with loading sni.dll again?

saurabh500 commented 8 years ago

@divega No changes from Data team for 1.0.1 to SqlClient

divega commented 8 years ago

Thanks @saurabh500. @muratg should we reactivate this or create a new issue? Also, do you think this could be an issue with the shared framework?

It has been reported also at https://blogs.msdn.microsoft.com/webdev/2016/09/13/asp-net-core-sept-2016-patch/#comments

ZombiesWithCoffee commented 8 years ago

Could it have something to do with the new "runtimes" requirement in project.json? I had to add it just to get 1.0.1 to run locally. Is there a different runtime for Azure?

    "runtimes": {
        "win10-x64": {}
    },

When I browse my Azure website on Server Explorer, I see

    /Files/runtimes/win
    /Files/runtimes/win7-x64
    /Files/runtimes/win7-x86

But if I change my runtimes to

   "runtimes": {
       "win10-x64": {},
       "win7-x64": {} 
   },

My build only generates the win10-x64 and I get the publish error message

           Error : Could not find a part of the path
           'D:\GitHub\SafeInvestigation\src\SafeInvestigation\bin\Release\netcoreapp1.0\win7-x64\SafeInvestigation.dll'.
ysilvestrov commented 8 years ago

I have the same issue; does anyone have any suggestions to fix it?

ZombiesWithCoffee commented 8 years ago

I'm trying something out, I hope to let you know in 30 more mins.

ZombiesWithCoffee commented 8 years ago

I finally figured out the issue! When you upgraded your app, your 'Microsoft.NETCoreApp' setting in your project.json was changed to

"Microsoft.NETCore.App": "1.0.1",

This generated an error message that told us to change the project file to include a runtime section. So I changed mine to this after reading several posts.

"runtimes": { "win10-x64": {} },

This fix only made things worse! The correct answer was to fix the setting by fixing the App 'type'.

"Microsoft.NETCore.App": { "version": "1.0.1", "type": "platform" },

ysilvestrov commented 8 years ago

@ZombiesWithCoffee Thanks, it works now!

odinnix commented 8 years ago

@ZombiesWithCoffee I'm having the exact same issue except I'm using NET46 instead of ASPNET Core so I don't have the "Microsoft.NETCore.App" dependency.

Also, I've turned on stdoutlogging however the files are empty. Web.config looks fine:

<?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=".\WebUI-New.exe" arguments="" stdoutLogEnabled="false" forwardWindowsAuthToken="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" />
    <staticContent>
      <remove fileExtension=".ts" />
      <mimeMap fileExtension=".ts" mimeType="application/x-typescript" />
      <remove fileExtension=".tsx" />
      <mimeMap fileExtension=".tsx" mimeType="text/plain" />
    </staticContent>
  </system.webServer>
</configuration>
<!--ProjectGuid: 619bb83b-97e0-4564-bfde-de5493e6163c-->

Project.json:

{
    "dependencies": {
        "Microsoft.AspNetCore.ReactServices": "1.0.0-*",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0",
        "Microsoft.AspNetCore.Razor.Tools": {
            "version": "1.0.0-preview2-final",
            "type": "build"
        },
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0",
        "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
        "Microsoft.Extensions.Configuration.Json": "1.0.0",
        "Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
        "Microsoft.Extensions.Logging": "1.0.0",
        "Microsoft.Extensions.Logging.Console": "1.0.0",
        "Microsoft.Extensions.Logging.Debug": "1.0.0",
        "EntityFramework": "6.1.3",
        "Migrator.EF6.Tools": {
            "version": "1.0.1",
            "type": "build"
        },
        "System.Linq": "4.1.0",
        "Newtonsoft.Json": "9.0.1",
        "Microsoft.Azure.KeyVault.Core": "1.0.0",
        "Microsoft.AspNetCore.Identity": "1.0.0",
        "MR.AspNet.Identity.EntityFramework6": "2.0.0",
        "CommonServiceLocator": "1.3.0",
        "Microsoft.Extensions.Options": "1.0.0",
        "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
        "Microsoft.Bcl.Build": "1.0.21",
        "Autofac.Extensions.DependencyInjection": "4.0.0",
        "Autofac.Extras.CommonServiceLocator": "4.0.0",
        "Microsoft.Bcl": "1.1.10",
        "ISO3166": "1.0.1",
        "WindowsAzure.Storage": "7.2.1",
        "Hangfire.Core": "1.6.4",
        "Microsoft.AspNetCore.Mvc": "1.0.1",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
        "Hangfire.AspNetCore": "1.6.4",
        "Hangfire.SqlServer": "1.6.4",
        "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
        "Microsoft.AspNetCore.Authentication.Facebook": "1.0.0",
        "Microsoft.AspNetCore.Authentication.Google": "1.0.0",
        "Hangfire.Autofac": "2.2.0"
    },
    "tools": {
        "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
        "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
        "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final",
        "Migrator.EF6.Tools": {
            "version": "1.0.1",
            "imports": "portable-net45+win8+dnxcore50"
        }
    },
    "frameworks": {
        "net46": {
            "dependencies": {
                "Authentication": {
                    "target": "project"
                },
                "Common": {
                    "target": "project"
                },
                "Domain": {
                    "target": "project"
                },
                "EFStorageProvider": {
                    "target": "project"
                },
                "Models": {
                    "target": "project"
                },
                "Services": {
                    "target": "project"
                }
            }

        }
    },
    "buildOptions": {
        "emitEntryPoint": true,
        "preserveCompilationContext": true
    },

    "runtimeOptions": {
        "configProperties": {
            "System.GC.Server": true
        }
    },

    "publishOptions": {
        "include": [
            ".babelrc",
            "appsettings.json",
            "App",
            "node_modules",
            "typings",
            "Views",
            "tsconfig.json",
            "tsd.json",
            "web.config",
            "webpack.*.js",
            "wwwroot"
        ]
    },

    "scripts": {
        "prepublish": [
            "npm install"
            // "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js",
            // "node node_modules/webpack/bin/webpack.js"
        ],
        "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
    },

    "tooling": {
        "defaultNamespace": "WebUI"
    }
}
ZombiesWithCoffee commented 8 years ago

I don't see anything obvious yet. You said that you had stdOutLog enabled, but you posted web.config with

    stdoutLogEnabled="false"
odinnix commented 8 years ago

Ah sorry about that, I've been pushing a ton to try and debug this. It was enabled, and it does create the stdOutLog files but they are completely empty. Trying with the runtime piece right now to see if it does anything.

ZombiesWithCoffee commented 8 years ago

A completely random untested shot in the dark... Try fixing it like I fixed mine. Replace

          "Microsoft.AspNetCore.Mvc": "1.0.1",

With

          "Microsoft.AspNetCore.Mvc": { "version": "1.0.1", "type": "platform" },
odinnix commented 8 years ago

Good thought, but that seems to just break the public with a null reference error here:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing.targets(149,5): Error : Object reference not set to an instance of an object.

<Publish RuntimeToolingDirectory ="$(SDKToolingDirectory)" ProjectFolder="$(MSBuildProjectDirectory)" Project="$(KPackWorkingDirectory)" Runtime="$(FinalPublishVersion)" WwwRoot="$(WebRoot)" WwwRootOut="$(WwwRootOut)" NoSource="$(NoSourceFlag)" Quiet="$(QuietFlag)" IncludeSymbols ="$(IncludeSymbolsFlag)" Native ="$(NativeFlag)" Configuration="$(PublishConfiguration)" Out="$(PublishOutputPathNoTrailingSlash)" ExternalToolsPath="$(ExternalToolsPath)" IsFilePreview="$(FilePreview)" IISCommand="$(IISCommand)" SDKToolingIdentifier="$(SDKToolingIdentifier)" PublishFramework="$(PublishFramework)" PublishRuntime="$(PublishRuntime)" NoBuild="$(NoBuildFlag)" BuildOutDirectory ="$(BuildOutDirNoSlash)" EnvironmentVariables="@(DnuPublishEnvironmentVariables)"/>

Thanks for the help @ZombiesWithCoffee, but this issue seems to be related to net46 pretty heavily. I'm going to try rolling back to 1.0.0 for the time being and open a new ticket.

moozzyk commented 8 years ago

Did you check eventLog? Since stdoutLog is created I assume AspNetCoreModule is trying to do something so it should write failures to eventLog. Have you also tried running the application directly? - go to the folder where the application is published and try running it directly (I assume it will actually work - if it failed you would see something in the stdoutLog). Remember that IIS runs as a different user so it might be an issue with permissions.

odinnix commented 8 years ago

@moozzyk Yep. See:

https://github.com/aspnet/IISIntegration/issues/270

It's Azure so I don't really have any permission options AFAIK.

BobbyTable commented 8 years ago

I have the same 502.5 error (when using dotnet461), heres a repro:

File > new ASP.NET Core 1 > Empty project

Build > Publish > Azure with default settings > Outputs Hello world! correctly

Change project.json to contain:

 "frameworks": {
    "net461": {}
  },

And remove "Microsoft.NETCore.App" reference. (This is the same as starting a new blank Core 1 project on .Net Framework)

Build > Publish > Azure with default settings > Gives HTTP Error 502.5 - Process Failure

Enabling stdout logging shows this error on the azure platform:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.Extensions.PlatformAbstractions.PlatformServices' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at Microsoft.Extensions.PlatformAbstractions.ApplicationEnvironment.GetApplicationBasePath()
   at Microsoft.Extensions.PlatformAbstractions.ApplicationEnvironment..ctor()
   at Microsoft.Extensions.PlatformAbstractions.PlatformServices..ctor()
   at Microsoft.Extensions.PlatformAbstractions.PlatformServices..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildHostingServices()
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
   at WebApplication15.Program.Main(String[] args) in MY PROJECT PATH/Program.cs:line 14
ZombiesWithCoffee commented 8 years ago

When publishing, do you have 'Remove additional files at destination' checked in the 'Settings' area of the publish window?

I literally went into my azure server and deleted every single assembly one at a time. Was the only way I got around the 502.5 error.

BobbyTable commented 8 years ago

@ZombiesWithCoffee ive tried with a checked "remove additional" files for all my slots with a clean core 1 project without luck. From you suggestion ive created a new webapp in azure and publishing to that works, so I obviously cant trust the "remove files" option. How did you clean you server? Via ftp?

Edit: My solution was to create a new slot in Azure (dont use your old ones, i had 502.5 errors on all) and swap this new for production slots and whatnot.

ZombiesWithCoffee commented 8 years ago

I'm embarrassed to say that I went into 'Server Explorer' via Visual Studio and manually deleted the files one at a time. It was therapeutic. I'm positive that there is a much better way to do it.

Edit: Glad that worked for you @deadZedd. I'm sure there's a lingering assembly out there being picked up via Dependency Injection.

moozzyk commented 8 years ago

I found that when you change frameworks in your project.json and republish the application to Azure (the same location/slot) the publish tool won't replace dlls at the target location if the names are the same. As a result you end up with stale dlls and you application won't work because after you have changed the framework it needs different versions. So yes, if you change the target framework you need to go to your Azure folder containing the old application and nuke all the dlls. I raised this issue with the tooling folks (the issue is in the internal repo https://github.com/aspnet/Tooling-Internal/issues/612 - but it is titled: "Remove additional files at destination" doesn't do its job because even if you select this option it won't remove stale dlls that have the same names as the new versions you are trying to publish). You can find more details in this thread: https://github.com/aspnet/Hosting/issues/801#issuecomment-227920473

HADB commented 8 years ago

Here's my problem and my solution: Problems:

  1. After upgrade Microsoft.NETCore.App to 1.0.1, I get 502.5 error when I use iis express.
  2. Change Microsoft.NETCore.App to 1.0.0, everything is OK.
  3. Publish to my server, both 1.0.1 and 1.0.0 are OK.

Solution: Install .NET Core 1.0.1 - VS 2015 Tooling Preview 2 in my computer.

Now I can work with Microsoft.NETCore.App 1.0.1 using iis express.

jakkaj commented 8 years ago

Removing the files worked for me too - the problem occurs when you change target frameworks between publishes.

You can easily delete all files using Kudu. Go to a CMD prompt, CD in to the wwwroot folder and type del /S * - that will delete all the old files :)

asadsahi commented 8 years ago

Thanks @jakkaj this trick worked for me too. I didn't even changed target framework, but was still having this problem during continuous deployments. I saw this error in few other websites deploying through VSTS CI process.

Lets see how long this works now.

Question to avoid confusion: Azure webapp should support all the stable versions of .net. If we have changed the version in a webapp, then deployment should respond to that. But strange thing is that some people are having this issue even they haven't changed version of .net core framewok during deployments.???

Uffman commented 7 years ago

My problem: Upgrade ASP.NET Core WebAPi to 1.1.0 If I publish to Azure from VS trough Publish action everything is OK. If I user Visual Studio Team Service Build and Release I get HTTP Error 502.5 - Process Failure. I found out the problem is in web.config. When published trough Visual Studio: <aspNetCore processPath="dotnet" arguments=".\Cvetlicarna.Web.dll" stdoutLogEnabled="true" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" /> Publish from VSTS: <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>

If I manually change this line on Azure, page works fine. Why isn't web.config changed by VSTS Build and Release process?

moozzyk commented 7 years ago

You are hitting a known issue where 1.1 runtime is not installed on VSTS agents. See this comment for resolution: https://github.com/aspnet/Hosting/issues/892#issuecomment-263407934

Same issue described here: https://github.com/aspnet/Home/issues/1842

/CC @muratg

Uffman commented 7 years ago

Tnx @moozzyk reverting to: "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" worked

asadsahi commented 7 years ago

Azure deployment happened successfully, but running app gives following error:

image

I haven't upgraded to new csproj yet and running using project.json with .net core 1.1 framework and targetting following sdk in global.json to force it to use this version:

{
    "projects": [
    ],
    "sdk": {
        "version": "1.0.0-preview2-1-003177"
    }
}

No idea what this error means. Anyone is aware of this issue?

ZombiesWithCoffee commented 7 years ago

That's the ONLY thing I could get with it. After a week, I finally abandoned the full .NET Framework and trying to switch to core, and I am still down.

https://forums.asp.net/t/2111351.aspx?After+upgrading+to+1+1+can+t+get+project+to+run+Fix+my+project+json

odinnix commented 7 years ago

@asadsahi Turn on STDOUT logging and see if anything pops up in there, also check all the Azure logs. I've seen that happen before and its usually due to something crashing in the startup class.

ZombiesWithCoffee commented 7 years ago

Thanks for the reminder dcarl1.

asadsahi, try this

        var webHost = new WebHostBuilder()
            .UseKestrel()
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseIISIntegration()
            .UseStartup<Startup>();

        // For debugging startup errors

        webHost.CaptureStartupErrors(true);
        webHost.UseSetting("detailedErrors", "true");

        webHost.Build().Run();
guardrex commented 7 years ago

[Sorry ... thought I pasted the wrong link there for a sec.]

The CaptureStartupErrors() is automatically done under UseIISIntegration() ...

https://github.com/aspnet/IISIntegration/blob/e4cf12017b90a28379650987b58c3d77cdb2a5cb/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs#L49

odinnix commented 7 years ago

@ZombiesWithCoffee I should mention we are using the full .NET framework on Azure with 1.1 (xproj not csproj). Didn't really change anything other then package versions.

So far no issues. Deployment went out last night so we will see if those CGI errors show up again.

ZombiesWithCoffee commented 7 years ago

I'm extremely happy for you @dcarl1 ! I had absolutely no luck and eventually had to delete and recreate my app services. And I'm still down!

@GuardRex, thanks for the update! I'll remove that from my startup code.