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

Figure 1, Troubleshooting 400 and 404
  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

Figure 2, Troubleshooting 400 and 404
  1. Access the same file from a browser while on the server and you see this error

image

Figure 3, Troubleshooting 400 and 404
  1. To resolve this issue set allowDoubleEscaping to true

image

Figure 4, Troubleshooting 400 and 404
  1. 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?
  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

Figure 6, Troubleshooting 400 and 404

image

Figure 7, Troubleshooting 400 and 404
  1. Access the same from the IIS server.

image

Figure 8, Troubleshooting 400 and 404
  1. 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

Figure 9, Troubleshooting 400 and 404

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

image

Figure 10, Troubleshooting 400 and 404

c. Try Network Monitor…

d. Try Fiddler

image

Figure 11, Troubleshooting 400 and 404

e. Last, set customError=Off

image

Figure 12, Troubleshooting 400 and 404

image

Figure 13, Troubleshooting 400 and 404

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

Figure 14, Troubleshooting 400 and 404
  1. Stop the Capture

image

Figure 15, Troubleshooting 400 and 404
  1. Enter HTTP into the Filter box and Apply

image

Figure 16, Troubleshooting 400 and 404
  1. Click the process where the error was capture within

image

Figure 17, Troubleshooting 400 and 404
  1. Find and review the error

image

Figure 18, Troubleshooting 400 and 404
  1. Open the same in Microsoft Message Analyzer

image

Figure 19, Troubleshooting 400 and 404

image

Figure 20, Troubleshooting 400 and 404

image

Figure 21, Troubleshooting 400 and 404