locked
Website giving 500 internal server error RRS feed

  • Question

  • User1624600859 posted

    Hi Team,

    The webapi deployed on window server 2019 having IIS 10 gives 500 internal server error the first time after deployment. But as we restart the IIS it goes away..

    Any clue, why it's happening

    Wednesday, April 21, 2021 10:50 AM

All replies

  • User1065476709 posted

    Hi Anmol,

    The webapi deployed on window server 2019 having IIS 10 gives 500 internal server error the first time after deployment. But as we restart the IIS it goes away..

    I think this may be caused by the cache, because after restart, the error disappeared.

    Best regards,

    Sam

    Thursday, April 22, 2021 1:33 AM
  • User1624600859 posted

    Hi samwu, 

    Thanks for the response. If it is due to cache so is there any other way of removing cache rather than restarting the IIS manually? I want this to be handled without user involvement. So that the user using the application doesn't face this. 

    Or is there any other scenario via which we can get the exact cause of this issue?

    Thursday, April 22, 2021 6:50 AM
  • User1065476709 posted

    Hi Anmol,

    Thanks for the response. If it is due to cache so is there any other way of removing cache rather than restarting the IIS manually? I want this to be handled without user involvement. So that the user using the application doesn't face this. 

    Or is there any other scenario via which we can get the exact cause of this issue?

    Can you reproduce this problem? If you can, please post a detailed error about 500 internal server error.

    If you can’t, it’s hard to find the problem.

    Best regards,

    Sam

    Thursday, April 22, 2021 9:34 AM
  • User1624600859 posted

    Till Now we have identified two things w.r.t. 500 issue for the deployed web API

    We have caught two error the time we faced 500 issue :-

    first one in iis failed request tracing

    1. <failedRequest url="https://TestURL/GetDataFromDB"
                     siteId="1"
                     appPoolId="DefaultAppPool"
                     processId="12504"
                     verb="GET"
                     remoteUserName=""
                     userName=""
                     tokenUserName="NT AUTHORITY\IUSR"
                     authenticationType="anonymous"
                     activityId="{80000C25-0002-C500-B63F-84710C7967BB}"
                     failureReason="STATUS_CODE"
                     statusCode="500"
                     triggerStatusCode="500"
                     timeTaken="31"
                     xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb"
                     >
    2. The second one in sql server log file viewer             
      2. Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Reason: Could not find a login matching the name provided. [CLIENT: MyIPAddress]

      I hope this info can provide some fruitful information samwu
    Friday, April 23, 2021 8:42 AM
  • User1065476709 posted

    Hi Anmol,

    first one in iis failed request tracing

    When you use failed request tracking, you will get an xml file, open it and you will see errors and warnings directly.

    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Reason: Could not find a login matching the name provided. [CLIENT: MyIPAddress]

    Please make sure you have selected "SQL Server Authentication" mode for user you created from Server > Security > Logins option.

    Best regards,

    Sam

    Friday, April 23, 2021 9:23 AM
  • User1624600859 posted

    The first is already the one pasted from the XML generated in failed request tracing of IIS.. Rest is there anything that we can do with regards to the first IIS one.

    The second one I will check

    Further I got this while searching other forums

    https://www.c-sharpcorner.com/UploadFile/specialhost/how-to-fix-login-failed-for-user-nt-authority-iusrs-in-share/#:~:text=%22IUSR%22%20is%20used%20when%20user,IUSR%22%20to%20the%20database%20permissions.

    Here I am more concerned with this statement in second paragraph

    To resolve this problem, either change the application pool identity or add "NT AUTHORITY\IUSR" to the database permissions

    Friday, April 23, 2021 10:48 AM
  • User1065476709 posted

    Hi Anmol,

    To resolve this problem, either change the application pool identity or add "NT AUTHORITY\IUSR" to the database permissions

    Has your problem been solved by this method?

    Best regards,

    Sam

    Monday, April 26, 2021 8:51 AM
  • User1624600859 posted

    Hi, 

    I noticed one more case, in which 500 internal error came on a client 1 machine, but on other client machines the same website was working fine. We investigated and set the iis_usrs permission for  the website directory on server. By this it started working on that specific client machine.

    IF we remove the iis_usrs permission, it again stops for client 1 machine but works for other.

    So solution is there but why the issue is happening on single client machine only for rest working fine

    Friday, May 14, 2021 10:39 AM
  • User1065476709 posted

    Hi Anmol,

    I noticed one more case, in which 500 internal error came on a client 1 machine, but on other client machines the same website was working fine. We investigated and set the iis_usrs permission for  the website directory on server. By this it started working on that specific client machine.

    IF we remove the iis_usrs permission, it again stops for client 1 machine but works for other.

    So solution is there but why the issue is happening on single client machine only for rest working fine

    Have you considered that it is caused by caching? Restart your iis and try again. Is it the same situation?

    Best regards,

    Sam

    Tuesday, May 18, 2021 3:03 AM
  • User1624600859 posted

    Yes, its the same. Further the case 1 is still not clear that why the below issue is coming in iis logs 

    1. <failedRequest url="https://TestURL/GetDataFromDB"
                     siteId="1"
                     appPoolId="DefaultAppPool"
                     processId="12504"
                     verb="GET"
                     remoteUserName=""
                     userName=""
                     tokenUserName="NT AUTHORITY\IUSR"
                     authenticationType="anonymous"
                     activityId="{80000C25-0002-C500-B63F-84710C7967BB}"
                     failureReason="STATUS_CODE"
                     statusCode="500"
                     triggerStatusCode="500"
                     timeTaken="31"
                     xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb"
                     >

    Is this also somehow related to permissions or what, any idea?

    Do microsoft provide paid support for production issue such as the one we are facing? If yes, please share link for the same.

    Tuesday, May 18, 2021 1:27 PM
  • User1065476709 posted

    Hi Anmol,

    Is this also somehow related to permissions or what, any idea?

    After you use failed request tracking, open the xml file, there will be a detailed information for the error.

    Do microsoft provide paid support for production issue such as the one we are facing? If yes, please share link for the same.

    https://support.microsoft.com

    Best regards,

    Sam

    Wednesday, May 19, 2021 8:47 AM