Azure Web App: HTTP Error 500 on favicon.ico
Asked Answered
A

3

12

I often get the following 500 server error after publishing to my Azure Web App.

If I delete the web app, recreate it, and republish, everything is fine again.

I retrieved the following error page by turning on diagnostics (in the Azure Portal) and locating the detailed error page in Visual Studio 2015's Cloud Explorer:

DetailedError

Error Page:

HTTP Error 500.0 - Internal Server Error

The page cannot be displayed because an internal server error has occurred.

Most likely causes:

  • IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
  • IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
  • IIS was not able to process configuration for the Web site or application.
  • The authenticated user does not have permission to use this DLL.
  • The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

Things you can try:

  • Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
  • Check the event logs to see if any additional information was logged.
  • Verify the permissions for the DLL.
  • Install the .NET Extensibility feature if the request is mapped to a managed handler.
  • Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.

Detailed Error Information:

Module ManagedPipelineHandler

Notification MapRequestHandler

Handler StaticFile

Error Code 0x00000000

Requested URL http://myurl:80/favicon.ico

Physical Path D:\home\site\wwwroot\favicon.ico

Logon Method Anonymous

Logon User Anonymous

There seems to be an issue with resolving favicon.ico. I have included and excluded this from the wwwroot deployment but with no difference.

Does anyone know what could be going wrong?

NOTE: I am using the following publish script from MSDN if it matters.

This is related to one of my previous posts.

Adherence answered 1/9, 2015 at 7:10 Comment(1)
I'm getting the same issue right now and it's really annoying. I can push my code just fine, no errors in that process; but once i try to go to the website i get a 500 error. Any solutions?Torpedoman
C
1

With ASP.NET 5 it can be hard to capture the error. In your Startup.cs file, you have a Configure method. Wrap everything within the Configure method into a try-catch block like this. Then you can slowly build out your app and see when it blows. At least you'll know that it is not in the Configure method or if it is, then you'll now which bit of additional functionality blew it. You can use this strategy in other methods too.

public void Configure(IApplicationBuilder app)
{
    // HACK: for Azure web apps,
    // the try-catch block lets us see errors that occur during configuration
    try
    {
        app.UseErrorPage();
        app.UseRuntimeInfoPage();
        app.UseStaticFiles();

        // add in remaining functionality one bit at a time...
    }
    catch (Exception ex)
    {
        app.Run(async (context) =>
        {
            await context.Response.WriteAsync(ex.ToString());
        });
    }

    // Run on each request
    app.Run(async (context) =>
    {
        await context.Response.WriteAsync("Hooray. It didn't error out.");
    }
}
Cyclops answered 1/9, 2015 at 23:46 Comment(1)
Surely I have a difficult problem? The error page I have is complaining about favicon.ico.Adherence
I
1

My problem ended up being that I had enabled the Help area for my API and had it set to use the auto-generated XML, but hadn't included that XML file in my solution (so it wasn't being published to azure). Not sure why it complains about the favicon though.

Importation answered 15/3, 2016 at 21:2 Comment(0)
J
0

This error message is little confusing. The real problem is with Startup.cs. You have to dicover it by turning on application in developer mode: Show ASP.NET 5 error page in Azure web app

Joleen answered 15/2, 2016 at 11:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.