Lab 23: Troubleshooting 400 and 404


Prerequisites

  • Review the requestFiltering attribute here
  • Read information about HTTP 400 – Bad Request here
  • Check out the new Microsoft Message Analyzer here
  • Check out Network Monitor here

Setup

  • Install and Configure CSharpGuitarBugs on an IIS server as described in Lab 1

Lab 23-1

1. Access the CSharpGuitarBugs website from a client machine, not from the IIS server, click on Full Catalog – ASPX, press the Next Page button and the following error is rendered, why? Q: Does the file being requested exist? A: Yes

image

1. If it exists, then why are you getting a 404? 404’s have a lot of sub-status codes… Q: Where do you find the sub-status code and what is it?  A: See options a. – d.

a. Access the website while on the server.

b. Look in the IIS logs

c. Failed Request Tracing logs

d. Turn on remote error rendering, by modifying the web.config file like the following

image

2. Access the same file from a browser while on the server and you see this error

image

3. To resolve this issue set allowDoubleEscaping to true

image

4. Refresh the website from a client machine, 404.11 is gone, continue to next lab, because now you get another error, right?

Lab 23-2

1. Access the CSharpGuitarBugs website from a client machine, not from the IIS server, click on Full Catalog – ASPX, press the Next Page button and the following error is rendered when selecting the following button, why?

image

2. What tools can you use to get more information from the client side? If you already configured customErrors in Lab 23-1, 1d, then you will not see the above, instead you will see the below. You can also use Fiddler or

image

image

 

3. Access the same from the IIS server.

image

4. How do you fix this? Q: Can it be fixed on the IIS side? A: No.  Colons are only allowed in the query string after a ?, you cannot have one anyplace in the URL

Lab 23-3

Setup

  • Make sure customErrors mode = ON, this is the most likely configuration so need to know how to troubleshoot without it
  • Check out Lab 10 for a similar lab.  Lab 10 also for the solution to this lab, I.e. change the MaxFieldLength and MaxRequestBytes both discussed further here

1. Access the CSharpGuitarBugs website from a client machine, not from the IIS server, click on Full Catalog – ASPX, press the Refresh button and the following error is rendered when selecting the following button, why?

2. What error do you get, how can you trouble shoot it?

a. Look in the IIS logs, what Status Code is being returned?

image

b. Look in the HTTP Error log, what is being returned there?

image

c. Try Network Monitor…

d. Try Fiddler

image

e. Last, set customError=Off

image

 

image

Lab 23-4

Take a Network Monitor Trace, reproduce the 400 and analyze it

1. Make sure customErrors mode=”Off” for the 400 web site, what happens when it is On?

2. Install Network Monitor on a remote machine, not on IIS

3. Start a Capture and reproduce the 400.

image

4. Stop the Capture

image

5. Enter HTTP into the Filter box and Apply

image

6. Click the process where the error was capture within

image

7. Find and review the error

image

8. Open the same in Microsoft Message Analyzer

image

image

Comments (1)

  1. Its worth mentioning that after getting the status code and sub status code, a very handy link is the following: https://support.microsoft.com/en-us/help/943891/the-http-status-code-in-iis-7.0,-iis-7.5,-and-iis-8.0. Great article!

Skip to main content