none
Web API 500 IIS Error Code RRS feed

  • Question

  • Hello,

    I'm hosting Web API in IIS, my client gets 500 error. From IIS logs I get this

    GET / - 80 - xxx Mozilla/5.0+(Windows+NT+6.3;+WOW64;+rv:54.0)+Gecko/20100101+Firefox/54.0 - 500 19 5 296

    GET /favicon.ico - 80 - xxx Mozilla/5.0+(Windows+NT+6.3;+WOW64;+rv:54.0)+Gecko/20100101+Firefox/54.0 - 500 19 5 62

    GET /favicon.ico - 80 - xxx Mozilla/5.0+(Windows+NT+6.3;+WOW64;+rv:54.0)+Gecko/20100101+Firefox/54.0 - 500 19 5 187

    I saw that 500.19 means config issue, but I don't see HResult here to look up the specifics. Do 2 numbers at the end mean anything? How can I find out what exactly is wrong with config?

    Thank you


    Isolda

    Monday, June 19, 2017 3:54 PM

Answers

  • Sure, although I can't explain why this worked. Application Pool I used had Identity of "ApplicationPoolIdentity" associated with it. I went to Advanced Settings for that application pool and changed it to "NetworkService" similar to other web apps that exist on this server. This has resolved 500.19 error, I suspect it had something to do with access permissions for that account. Sorry, I can't provide more intelligent explanation.

    Isolda

    • Marked as answer by Isolda Thursday, June 22, 2017 7:59 PM
    Thursday, June 22, 2017 7:59 PM

All replies

  • You can post to the Web API form too.

    https://forums.asp.net/1246.aspx/1?Web+API

    Monday, June 19, 2017 4:39 PM
  • Hi Isolda,

    Did your Web API work under development? Have you installed all the IIS windows features? I suggest you refer below link.

    # IIS - this configuration section cannot be used at this path (configuration locking?)

    https://stackoverflow.com/questions/9794985/iis-this-configuration-section-cannot-be-used-at-this-path-configuration-lock/12867753#12867753

    In addition, I suggest you try to add below code to your web.config to get detailed error message.

      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
        <!--
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
          -->
        <directoryBrowse enabled="true"/>
        <httpErrors errorMode="Detailed"/>
      </system.webServer>
    

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 20, 2017 2:56 AM
  • Thank you all for replies, through trial and error found that this was a permission issue with account under which the service was running.

    Isolda

    Wednesday, June 21, 2017 2:30 PM
  • Hi Isolda,

    I am glad you have found the root cause.

    If your issue has been resolved, I would suggest you share us your solution and then mark it as answer, or mark the helpful suggestion which helps you to resolve this issue.

    If your issue has not been resolved, please feel free to let us know.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 22, 2017 1:36 AM
  • Sure, although I can't explain why this worked. Application Pool I used had Identity of "ApplicationPoolIdentity" associated with it. I went to Advanced Settings for that application pool and changed it to "NetworkService" similar to other web apps that exist on this server. This has resolved 500.19 error, I suspect it had something to do with access permissions for that account. Sorry, I can't provide more intelligent explanation.

    Isolda

    • Marked as answer by Isolda Thursday, June 22, 2017 7:59 PM
    Thursday, June 22, 2017 7:59 PM