Skip to content

Commit 56e117e

Browse files
authored
minor updates
1 parent f5d6dc9 commit 56e117e

2 files changed

Lines changed: 26 additions & 24 deletions

File tree

support/developer/webapps/iis/site-behavior-performance/troubleshoot-http-error-code.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,43 @@ ms.custom: sap:Site Behavior and Performance\Runtime errors and exceptions, incl
77
---
88
# Troubleshoot 4xx and 5xx HTTP errors
99

10-
This article provides troubleshooting steps for resolving 4*xx* and *5xx* HTTP status code errors in Internet Information Services (IIS). These errors can indicate issues on the client or server side. The guidance will help you identify the cause of these errors and resolve them effectively.
10+
This article provides troubleshooting steps for resolving [4xx](../health-diagnostic-performance/http-status-code.md#4xx---client-error) and [5xx](../health-diagnostic-performance/http-status-code.md#5xx---server-error) HTTP status code errors in Internet Information Services (IIS). These errors can indicate issues on the client or server side. The guidance will help you identify the cause of these errors and resolve them effectively.
1111

1212
## Identify 4xx errors
1313

14-
4*xx* HTTP status codes indicate that an error occurred due to a client-side issue. For example, the client browser might have requested a page without providing valid authentication information.
14+
[4xx](../health-diagnostic-performance/http-status-code.md#4xx---client-error) HTTP status codes indicate that an error occurred due to a client-side issue. For example, the client browser might have requested a page without providing valid authentication information.
1515

16-
To identify 4*xx* errors, see the IIS logs and the HTTPERR logs:
16+
To identify [4xx](../health-diagnostic-performance/http-status-code.md#4xx---client-error) errors, see the [IIS logs](#examine-the-iis-logs) and the [HTTPERR logs](#examine-the-httperr-logs):
1717

1818
- The HTTP status code is recorded in the IIS logs. This file is usually stored in **C:\inetpub\logs\Logfiles** but can be configured via IIS **Logging** in IIS Manager.
1919
- A 4*xx* error code can be generated by the **HTTP.sys** kernel driver, which means these requests might not reach IIS and thus won't be logged in IIS logs. **HTTP.sys** logs these errors in separate files called [HTTPERR logs](/windows/win32/http/error-logging-in-the-http-server-api). This file is usually stored in **C:\Windows\System32\LogFiles\HTTPERR** but can be configured via the registry `HKEY\LOCAL\MACHINE\System\CurrentControlSet\Services\HTTP\Parameters\ErrorLoggingDir`.
20-
- One way to confirm if the 4*xx* response is coming from **HTTP.sys** is to collect a HAR trace on the client and look for the response header **Microsoft-HttpApi/2.0**.
20+
- One way to confirm if the 4*xx* response is coming from **HTTP.sys** is to collect a HAR trace file on the client and look for the response header **Microsoft-HttpApi/2.0**.
2121

22-
To capture a HAR file, which records your browser's interaction with the website, follow the instructions in [Capture a browser trace for troubleshooting](/azure/azure-portal/capture-browser-trace#microsoft-edge).
22+
To capture a HAR trace file, which records your browser's interaction with the website, follow the instructions in [Capture a browser trace for troubleshooting](/azure/azure-portal/capture-browser-trace#microsoft-edge).
2323

2424
### Examine the IIS logs
2525

2626
If you find errors in the IIS logs, note the status code (`sc-status`) and substatus code (`sc-substatus`) and see [HTTP status code overview](../health-diagnostic-performance/http-status-code.md#4xx---client-error) for more information.
2727

28-
To get more information on the status code and understand which module or handler returned 4*xx* errors, collect [Failed Request Trace (FREB) logs](#steps-to-capture-freb-logs) around the time the issue occurred by configuring a FREB rule to be triggered by the status code seen in the IIS logs.
28+
To get more information on the status code and understand which module or handler returned [4xx](../health-diagnostic-performance/http-status-code.md#4xx---client-error) errors, collect [Failed Request Trace (FREB) logs](#steps-to-capture-freb-logs) around the time the issue occurred by configuring a FREB rule to be triggered by the status code seen in the IIS logs.
2929

3030
### Examine the HTTPERR logs
3131

3232
If you find errors in the HTTPERR logs, note the reason (`s-reason`) and see [Types of Errors Logged by the HTTP Server API](/windows/win32/http/types-of-errors-logged-by-the-http-server-api) for more information.
3333

3434
## Identify 5xx errors
3535

36-
5*xx* HTTP status codes indicate that the server couldn't complete the request because the server encountered an error when processing the request. Use the following instructions based on your application type.
36+
[5xx](../health-diagnostic-performance/http-status-code.md#5xx---server-error) HTTP status codes indicate that the server couldn't complete the request because the server encountered an error when processing the request. Use the following instructions based on your application type.
3737

38-
### Classic ASP: 500 errors
38+
### 500 errors in classic ASP
3939

40-
If any error occurs in classic ASP, check the error code or error message in the `cs-uri-query` of the IIS logs.
40+
If any error occurs in classic ASP, check the error code or error message in the `cs-uri-query` query of the IIS logs.
4141

4242
For more information, capture and examine [Failed Request Trace (FREB) logs](#steps-to-capture-freb-logs) for the 500 errors.
4343

44-
### General IIS: 500 errors
44+
### 500 errors in general IIS
4545

46-
Examine the IIS logs, note `sc-status` and `sc-substatus`, and look for the status code in [HTTP status code overview](../health-diagnostic-performance/http-status-code.md#5xx---server-error) for more information on the failure.
47-
48-
Enable detailed error messages if feasible to get more details.
46+
If any error occurs in general IIS, examine the IIS logs, note `sc-status` and `sc-substatus`, and look for the status code in [HTTP status code overview](../health-diagnostic-performance/http-status-code.md#5xx---server-error) for more information on the failure. Enable detailed error messages if feasible to get more details.
4947

5048
To enable detailed error messages, follow these steps:
5149

@@ -67,11 +65,13 @@ To enable detailed error messages, follow these steps:
6765

6866
:::image type="content" source="media/troubleshoot-http-error-code/edit-error-pages-settings.png" alt-text="Screenshot of the Edit Error Pages Settings dialog.":::
6967

70-
We don't recommend sending detailed errors for remote requests since this might expose sensitive information to the Internet. You need to revert the changes once you have more information on the failure.
68+
We don't recommend sending detailed errors for remote requests since this option might expose sensitive information to the Internet. You need to revert the changes once you have more information on the failure.
7169

7270
For more information, capture and examine [Failed Request Trace (FREB) logs](#steps-to-capture-freb-logs) for the 500 errors.
7371

74-
### ASP.NET: 500 errors
72+
### 500 errors in ASP.NET
73+
74+
If any error occurs in ASP.NET, use the following methods to identify the cause of the error and resolve it:
7575

7676
- Check the Application Event Logs.
7777

@@ -103,7 +103,9 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
103103

104104
For 500 errors due to exceeding the ASP.NET ExecutionTimeout, [capture a PerfView trace and dumps](#steps-to-capture-a-perfview-trace-and-dumps) to identify any delays.
105105

106-
### ASP.NET Core: 500 errors
106+
### 500 errors in ASP.NET Core
107+
108+
If any error occurs in ASP.NET Core, use the following methods to identify the cause of the error and resolve it:
107109

108110
- Check the Application Event Logs.
109111

@@ -114,9 +116,9 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
114116
1. Select **Application** to open the Application Event Logs.
115117
1. Search for errors associated with the failed application. The value in the **Source** column for the errors is **IIS AspNetCore Module** or **IIS Express AspNetCore Module**.
116118

117-
- Enable the Developer Exception Page.
119+
- Enable the [Developer Exception Page](/aspnet/core/fundamentals/error-handling#developer-exception-page).
118120

119-
The `ASPNETCORE\_ENVIRONMENT` [environment variable can be added to web.config](/aspnet/core/host-and-deploy/aspnet-core-module#setting-environment-variables) to run the application in the development environment. As long as the environment isn't overridden in application startup by UseEnvironment on the host builder, setting the environment variable allows the [Developer Exception Page](/aspnet/core/fundamentals/error-handling) to appear when the application is run.
121+
The `ASPNETCORE_ENVIRONMENT` environment variable can be added to **web.config** to run the application in the development environment. If you don't override the environment setting in your application's startup code using the `UseEnvironment` method on the host builder, the environment variable allows the [Developer Exception Page](/aspnet/core/fundamentals/error-handling#developer-exception-page) to appear when the application is run.
120122

121123
```xml
122124
<aspNetCore processPath="dotnet"
@@ -125,14 +127,14 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
125127
stdoutLogFile=".\logs\stdout"
126128
hostingModel="InProcess">
127129
<environmentVariables>
128-
<environmentVariable name="ASPNETCORE\_ENVIRONMENT" value="Development" />
130+
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
129131
</environmentVariables>
130132
</aspNetCore>
131133
```
132134

133-
Setting the environment variable for `ASPNETCORE\_ENVIRONMENT` is only recommended on staging and test servers not exposed to the Internet. Remove the environment variable from the **web.config** file after troubleshooting.
135+
Setting the environment variable for `ASPNETCORE_ENVIRONMENT` is only recommended on staging and test servers not exposed to the Internet. Remove the environment variable from the **web.config** file after troubleshooting.
134136

135-
- Enable the ASP.NET Core Module stdout log.
137+
- Enable the ASP.NET Core Module `stdout` log.
136138

137139
To enable and view stdout logs, follow these steps:
138140

@@ -148,7 +150,7 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
148150
</aspNetCore>
149151
```
150152

151-
1. `stdout` in the path is the log file name prefix. A timestamp, process ID (PID), and file extension are added automatically when the log is created. Using `stdout` as the file name prefix, a typical log file name is **stdout\_20180205184032\_5412.log**.
153+
1. Use `stdout` as the file name prefix. A timestamp, process ID (PID), and file extension are added automatically when the log is created. A typical log file name is **stdout\_<timestamp\>\_<PID\>.log**.
152154
1. Ensure your application pool's identity has write permissions to the **logs** folder.
153155
1. Save the updated **web.config** file.
154156
1. Make a request to the application.
@@ -176,7 +178,7 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
176178

177179
Confirm that the path specified for the log exists and that the application pool's identity has write permissions to the location.
178180

179-
### ARR: 502 errors
181+
### 502 errors in ARR
180182

181183
Follow the instructions in [Troubleshooting 502 errors in ARR](../application-request-routing/troubleshooting-502-errors-in-arr.md).
182184

support/developer/webapps/iis/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ items:
154154
href: site-behavior-performance/internet-printing-fails.md
155155
- name: Runtime errors and exceptions
156156
items:
157-
- name: Troubleshoot HTTP errors in IIS
157+
- name: Troubleshoot 4xx and 5xx HTTP errors
158158
href: site-behavior-performance/troubleshoot-http-error-code.md
159159
- name: Troubleshoot HTTP 400 errors in IIS
160160
href: site-behavior-performance/troubleshoot-http-400-errors-in-iis.md

0 commit comments

Comments
 (0)