benjamin perkins, (aka @csharpguitar)

Lab 23: Troubleshooting 400 and 404

Prerequisites

Setup

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

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

Figure 6, Troubleshooting 400 and 404

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

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

  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?

Troubleshooting 400 and 404

Figure 9, Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

Figure 10, Troubleshooting 400 and 404

c. Try Network Monitor…

d. Try Fiddler

Troubleshooting 400 and 404

Figure 11, Troubleshooting 400 and 404

e. Last, set customError=Off

Troubleshooting 400 and 404

Figure 12, Troubleshooting 400 and 404

Troubleshooting 400 and 404

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.

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

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

Troubleshooting 400 and 404

Figure 19, Troubleshooting 400 and 404

Troubleshooting 400 and 404

Figure 20, Troubleshooting 400 and 404

Troubleshooting 400 and 404

Figure 21, Troubleshooting 400 and 404