Skip to content
This repository was archived by the owner on Nov 1, 2018. It is now read-only.
This repository was archived by the owner on Nov 1, 2018. It is now read-only.

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

Description

@CharlBest

image

I updated my projects from .NET Core 1.1 to .NET Core 2.0.
I then deploy my API app and Web app via Visual Studio 2017 15.3 web deploy and now have these errors when visiting my apps.

I have tried the possible fix mentioned in this Stack Overflow post but it doesn't seem to work. https://stackoverflow.com/questions/45694286/net-core-2-0-azure-app-service-502-5-error/45715420#45715420

This was a problem in the past here: #252
I also spoke to @davidebbo about this in Azure/app-service-announcements-discussions#6 (comment)

Thanks in advance.

Activity

  1. changed the title [-]HTTP Error 502.5 - Process Failure" asp.net core error in Azure[/-] [+]HTTP Error 502.5 - Process Failure" asp.net core 2 error in Azure[/+] on Aug 16, 2017
  2. pan-wang commented on Aug 16, 2017

    @pan-wang
    Contributor

    @CharlBest Could you please turn on logging from web.config and collect Windows event log? Those logs will give the hint on why the failure happens.

  3. CharlBest commented on Aug 16, 2017

    @CharlBest
    Author

    @pan-wang how would I do that? Firstly I don't have a web.config file in my solution and secondly not sure what code to write. Can you please specify?

  4. CharlBest commented on Aug 16, 2017

    @CharlBest
    Author

    @pan-wang I got this from my Log Stream on Azure. Hope it helps
    image

  5. JunTaoLuo commented on Aug 16, 2017

    @JunTaoLuo
    Contributor

    The web.config is produced by the publish step if none is provided in the solution. You need to modify the stdoutLogEnabled value in the line line

    <aspNetCore processPath="dotnet" arguments=".\App.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    

    to true and make sure the directory specified in stdoutLogFile exists.

  6. davidebbo commented on Aug 16, 2017

    @davidebbo

    More specifically, you'll need to use Kudu Console (https://{yourapp}.scm.azurewebsites.net/), go to site\wwwroot, and edit the web.config you see in there.

  7. CharlBest commented on Aug 16, 2017

    @CharlBest
    Author

    Thanks @davidebbo. I used the new awesome App Service Editor (Preview). Really really nice. Feels like VS Code on the web. Very impressed. Anyway got this message in my logs:

    Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Hosting.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    at Things.Api.Program.Main(String[] args)

  8. JunTaoLuo commented on Aug 16, 2017

    @JunTaoLuo
    Contributor

    This could be potentially a problem with the runtime store containing mismatching binaries. Let me see if I can reproduce the issue.

  9. CharlBest commented on Aug 16, 2017

    @CharlBest
    Author

    Ok cool. Thanks @JunTaoLuo Let me know if I can do something :)

  10. davidebbo commented on Aug 16, 2017

    @davidebbo

    See https://stackoverflow.com/questions/44550096/asp-net-core-2-0-on-azure-results-in-a-502-5. That issue relates to having old things leftover from previous 1.x deployment. Can you try wiping out wwwroot and deploying clean?

  11. CharlBest commented on Aug 16, 2017

    @CharlBest
    Author

    Yayyyyy @davidebbo Its working. Thank you.

    1. I couldn't understand why you would want me to wipe the wwwroot folder as it only contains static web stuff. Then I saw that all die dll files are also in a folder called WWWROOT.
    2. I removed the wwwroot folder (not emptying it and leaving the empty folder) and got a deployment error. Re-added an empty WWWROOT folder and deployment was happy.
      But it looks like its working now. Tested with my API app and will update this comment if the Web app also works but I think it will.

    You guys are awesome. Thank you so much for the quickly replies. 👍

    Update:
    Web App Service is also up and running after clearing the wwwroot folder. Thanks again.

  12. davidebbo commented on Aug 16, 2017

    @davidebbo

    Awesome! @pan-wang, we can probably close this, and hopefully others running into it will find the issue.

    Unfortunately, it's more an msdeploy issue (leaving dirty files) then an Azure or Core issue.

  13. fpizarro commented on Aug 23, 2017

    @fpizarro

    Hi guys, today I had the same problem. My approach was specify Release X86 in the settings tab in the publish form in Visual Studio 2017.

    I did this because the assemblies for deployment are stored in the local path for x86, you can find them on your machine: cd "%ProgramFiles(x86)%\dotnet\store"
    image

  14. ddobric commented on Aug 25, 2017

    @ddobric

    Hi all,

    1. where is the physical path of '.\logs\stdout' ? Under LogFiles? Where we have to create the folder stdout?

    2. Previously we have used
      UseSetting("detailedErrors", "true")
      CaptureStartupErrors(true)
      to output errors. Now this does not work anymore.

    My general feedback on diagnostics:
    In general, figuring out of such kind of errors is extremely complex. We have to use advanced tools to find very simple errors. Then, we have to do lot of configuration (enable diagnostics etc.)
    At the end we have too many sources like logstream, application logfiles, eventlog files, Detailed Errors (which is nothing that HTML page shown to the user. It means it is not detailed), dumps,..

    Last but not least, at the moment of writing of this, I still do not know what is my error. :)

    My expectation is following:

    1. Application Fails.
    2. Admin LogsOn to portal and see the error.

    No configuration, no web.config changes, no KUDU.

    Thanks

  15. 13 remaining items

  16. khachornchit commented on Dec 14, 2017

    @khachornchit

    Hi,
    Have you fixed it ?
    Here is the solution https://youtu.be/rAA1FVA0fog

  17. bigo92 commented on Dec 28, 2017

    @bigo92
  18. khachornchit commented on Dec 28, 2017

    @khachornchit

    You are welcome.

  19. arunprasathv commented on Feb 1, 2018

    @arunprasathv

    is there a different command to do Framework Dependent Deployment. Its recommended. @PlutoSolutions \

  20. agnimitra commented on Feb 13, 2018

    @agnimitra

    I ran through the same issue today and have fixed by changing web.config file.
    https://stackoverflow.com/questions/38624453/asp-net-core-1-0-on-iis-error-502-5/48761913#48761913

  21. AdrianPT commented on Mar 5, 2018

    @AdrianPT

    I my case was a .Net framework that was not installed in the IIS server.

    My project have the .Net Framework 4.6.1 as target... so I install the .Net Framework 4.6.1 in the server and the problem is solved.

  22. haydenhancock commented on Mar 16, 2018

    @haydenhancock

    Does Azure support Microsoft.AspNetCore.All (2.0.6) yet? I am having the same issue when deploying a newly created project from Visual Studio 2017 15.6.2. Microsoft.AspNetCore.All (2.0.6) is what ships with this version of Visual Studio 2017. The issue can easily be reproduce by following these steps:

    1. Open Visual Studio.
    2. Click File > New > Project.
    3. Select .NET Core and choose ASP.NET Core Web Application.
    4. Leave other defaults and click OK.
    5. Select API, click OK.
    6. Right-click project, select Publish....
    7. Click Publish.
    8. Ensure app service settings are complete, click Create.
    9. The publish succeeded, however, the Site Url throws a 502.5 Error.

    Attempting to downgrade to < 2.0.6 doesn't work; publishing will throw an error.

    Severity Code Description Project File Line Suppression State Error The command ""dotnet" exec --runtimeconfig "C:\Users\Hayden Hancock\source\repos\WebApplication2\WebApplication2\bin\Release\netcoreapp2.0\WebApplication2.runtimeconfig.json" --depsfile "C:\Users\Hayden Hancock\source\repos\WebApplication2\WebApplication2\bin\Release\netcoreapp2.0\WebApplication2.deps.json" "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.3\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj\Release\netcoreapp2.0\microsoft.aspnetcore.mvc.razor.viewcompilation.rsp"" exited with code 1. WebApplication2 0

    It won't let me post what my web.config looks like from the App Service Editor.

  23. Tratcher commented on Mar 16, 2018

    @Tratcher
    Member

    The deployment is not complete, see Azure/app-service-announcements#92

  24. davidebbo commented on Mar 16, 2018

    @davidebbo

    The deployment is now complete.

  25. haydenhancock commented on Mar 16, 2018

    @haydenhancock

    @davidebbo Thanks for the update. I will attempt another deployment when I am able and let you know the result.

    I attempted a deployment using Visual Studio 2017 15.5.7 which ships with Microsoft.AspNetCore.All (2.0.5) and I still have issues (http://webapplication320180316115814.azurewebsites.net/).

    Any reason, that you are aware of, that would cause downgrades of Microsoft.AspNetCore.All to cause build issues with Visual Studio 2017 15.6.2?

  26. davidebbo commented on Mar 16, 2018

    @davidebbo

    @haydenhancock I think it would be best to open a new issue to discuss. This one looks like it's been already used for various unrelated issues (even if they all happen to end up with a Process Failure), and it's been closed for a while. Also, please include a sample repo to make it easier to investigate. Thanks!

  27. haydenhancock commented on Mar 16, 2018

    @haydenhancock

    @davidebbo Done #681. Thanks!

  28. JasonKnarr commented on Apr 4, 2018

    @JasonKnarr

    If anyone happens to get this far in the comments and is having the same issue, check to see if the correct .NET SDK is installed on the server you are publishing to.

    In my case, all I had to do was install the .NET Core 2 SDK and the API started working after my upgrade.

  29. enginaar commented on May 31, 2018

    @enginaar

    This just started happening out of nowhere and a quick investigation revealed that it's having trouble finding the Microsoft.AspNetCore.Antiforgery library which I don't use. I don't have any problems on my dev env, this is only happening on the staging server.

    I have found a couple of workarounds but what I care about right now if anybody knows why this is happening. I'm about to go live with a project using .net core the first time and I cannot afford this happening on production.

  30. osca2000 commented on Jul 6, 2018

    @osca2000

    If a project dll name contains space, why will it cause 502 error? For example "my web api.dll" (assembly name in VS) causes the error but "mywebapi.dll" works perfect. I spent millions seconds to figure out a workaround to fix the error. In VS, a dll name with space runs ok but as soon as it is published, it won't work with "HTTP Error 502.5 - Process Failure".

    Azure documents may have the naming convention such as "do not have space in assembly name" i don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions