You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/developer/webapps/iis/site-behavior-performance/troubleshoot-http-error-code.md
+25-23Lines changed: 25 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,45 +7,43 @@ ms.custom: sap:Site Behavior and Performance\Runtime errors and exceptions, incl
7
7
---
8
8
# Troubleshoot 4xx and 5xx HTTP errors
9
9
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.
11
11
12
12
## Identify 4xx errors
13
13
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.
15
15
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):
17
17
18
18
- 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.
19
19
- 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**.
21
21
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).
23
23
24
24
### Examine the IIS logs
25
25
26
26
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.
27
27
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.
29
29
30
30
### Examine the HTTPERR logs
31
31
32
32
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.
33
33
34
34
## Identify 5xx errors
35
35
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.
37
37
38
-
### Classic ASP: 500 errors
38
+
### 500 errors in classic ASP
39
39
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.
41
41
42
42
For more information, capture and examine [Failed Request Trace (FREB) logs](#steps-to-capture-freb-logs) for the 500 errors.
43
43
44
-
### General IIS: 500 errors
44
+
### 500 errors in general IIS
45
45
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.
49
47
50
48
To enable detailed error messages, follow these steps:
51
49
@@ -67,11 +65,13 @@ To enable detailed error messages, follow these steps:
67
65
68
66
:::image type="content" source="media/troubleshoot-http-error-code/edit-error-pages-settings.png" alt-text="Screenshot of the Edit Error Pages Settings dialog.":::
69
67
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.
71
69
72
70
For more information, capture and examine [Failed Request Trace (FREB) logs](#steps-to-capture-freb-logs) for the 500 errors.
73
71
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:
75
75
76
76
- Check the Application Event Logs.
77
77
@@ -103,7 +103,9 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
103
103
104
104
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.
105
105
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:
107
109
108
110
- Check the Application Event Logs.
109
111
@@ -114,9 +116,9 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
114
116
1. Select **Application** to open the Application Event Logs.
115
117
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**.
116
118
117
-
- Enable the Developer Exception Page.
119
+
- Enable the [Developer Exception Page](/aspnet/core/fundamentals/error-handling#developer-exception-page).
118
120
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 UseEnvironmenton 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.
120
122
121
123
```xml
122
124
<aspNetCoreprocessPath="dotnet"
@@ -125,14 +127,14 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
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.
134
136
135
-
- Enable the ASP.NET Core Module stdout log.
137
+
- Enable the ASP.NET Core Module `stdout` log.
136
138
137
139
To enable and view stdout logs, follow these steps:
138
140
@@ -148,7 +150,7 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
148
150
</aspNetCore>
149
151
```
150
152
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**.
152
154
1. Ensure your application pool's identity has write permissions to the **logs** folder.
153
155
1. Save the updated **web.config** file.
154
156
1. Make a request to the application.
@@ -176,7 +178,7 @@ For more information, capture and examine [Failed Request Trace (FREB) logs](#st
176
178
177
179
Confirm that the path specified for the log exists and that the application pool's identity has write permissions to the location.
178
180
179
-
### ARR: 502 errors
181
+
### 502 errors in ARR
180
182
181
183
Follow the instructions in [Troubleshooting 502 errors in ARR](../application-request-routing/troubleshooting-502-errors-in-arr.md).
0 commit comments