Today I faced a problem during the setup of a new application: if I opened a browser and entered the URL of the application, I got the following error message
To be able to identify the root cause of the error, I found a new feature added in the latest versions of Microsoft IIS (Internet Information Services): the failed request tracing. Using this tool you can selectively trace all the processing pipeline of a request to identify which step causes the error reported to the user.
Let’s see how to use it. First, verify that this feature is installed on your server using the Server Manager:
Open the IIS Manager tool, select the site which publishes the application and in the Actions pane (on the right) click on Failed Request Tracing…:
Enable the feature and note down the path IIS will save the logs into:
Now you have to specify which requests will be traced. Click on the icon:
then click on Add... in the Actions pane.
Thanks to a wizard you can define the criteria a request must match to be traced. For example in the screenshot below I created a tracing rule for the requests which return error 401.3:
If I reloaded the page with my browser, in the path above I could find the trace logs:
With a double-click on the frxxxxxx files, a page with all the details of the request was displayed:
When I moved to the Request Details tab I was able to identify the folder IIS couldn’t access:
When I set the correct permissions on the NTFS filesystem, the application started to work.