403 (Forbidden)
The 403 error code is returned because you do not have access to the API and the server receives the request but refuses to provide the service.
Possible cause 1
The request fails to be accepted due to the backend authentication settings of your server. In this case, the error is caused by the backend service.
Solution: Check the authentication mechanism of the service.
Possible cause 2
The server gateway performs strong verification on the User-Agent
(UA) in the request header. If the UA is invalid, the server gateway returns an error message indicating that you do not have the required permissions. The default UA in the request initiated by PTS contains a special character so that some services can distinguish between statistical traffic and throttling rules.
Solution
Log on to the PTS console and choose .
Select your stress testing scenario and click Edit in the Actions column. On the Header Definition tab of the Scenario Settings page, add a common UA, as shown in the following figure.
Key
: User-Agent
Value
: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36

Click Debug. On the Request Details page, check whether the request is normal. If the request is normal after the UA is modified, the error is caused by the UA verification. In this case, you can continue the stress testing by modifying the UA.
Possible cause 4
The domain name for stress testing is not filed, or the domain name is resolved to another domain name that is not filed.
Solution: Check whether the domain name is filed based on the returned result. If a 403 error occurs and the following HTML information is returned, the domain name is not filed. In this case, you must apply for an ICP filing for the domain name first.
<html>
<head>
<meta http-equiv="Content-Type" content="textml;charset=UTF-8" />
<style>body{background-color:#FFFFFF}</style>
<title>TestPage184</title>
<script language="javascript" type="text/javascript">
window.onload = function () {
document.getElementById("mainFrame").src= "http://****.aliyun.com/alww.html";
}
</script>
</head>
<body>
<iframe style="width:860px; height:500px;position:absolute;margin-left:-430px;margin-top:-250px;top:50%;left:50%;" id="mainFrame" src="" frameborder="0" scrolling="no"></iframe>
</body>
</html>
405 (Method Not Allowed)
The 405 error may occur due to the following reasons:
A 302 redirect occurs for POST requests. The request method is changed when a 302 redirect occurs. In this case, the server may not be able to recognize the request method. Therefore, a 405 error is returned.
The request server directly verifies the method, and the corresponding response header contains the Allow=GET
information.
When you use an SLB instance or web server for forwarding, you modify the request method but the backend server cannot recognize the modification.
406 (Not Acceptable)
A client error occurs. A response entity cannot be generated because the content of the requested resource cannot meet the conditions in the request header.
Possible cause
A 406 error occurs during debugging because the Accept
field configured on the Header Definition tab of the request is invalid.
Accept
: the type of data that the sender expects to accept. In this example, the sender is PTS.
Content-Type
: the type of the data sent by the sender (PTS). The Content-Type
that you configure on the Body Definition tab of the Scenario Settings page is automatically synchronized to the Header Definition tab. If the Accept
field configured on the Header Definition tab does not match the agreed content, a 406 error is returned.

Solution
Make sure that the server can verify the Accept type. You can confirm the Accept
types that the server is able to validate by setting a different Value
for each Accept
type. The following table describes the format types of the Accept
header and the matching order.
Table 1. Format types of the Accept
header
Format type | Format type |
text/html
| HTML format |
text/plain
| Plain text format |
text/xml
| XML format |
image/gif
| GIF image format |
image/jpeg
| JPG image format |
image/png
| PNG image format |
application/xhtml+xml
| XHTML format |
application/xml
| XML data format |
application/atom+xml
| Atom XML aggregation format |
application/json
| JSON data format |
application/pdf
| PDF format |
application/msword
| Word document format |
application/octet-stream
| Binary stream data, such as common file downloads. |
application/x-www-form-urlencoded
| The default encType in <form encType=""> . By default, the data submitted in forms is encoded as key-value pairs and sent to the server. |
When the following Accept headers are configured: application/xml , text/html , and application/json | The produces are matched in the following order: application/xml > text/html > application/json
|
When the following Accept headers are configured: application/xml;q=0.3 , application/json;q=0.8 , and text/html | The produces are matched in the following order: text/html > application/json > application/xml
Note The application/xml parameter is the quality factor of the media type. A larger number indicates a higher priority (from 0 to 1). |
When the following Accept headers are configured: */* , text/* , and text/html | The produces are matched in the following order: text/html > text/* > */*
|
503 (Service Unavailable)
Possible cause 1
The backend server refuses to receive the request because it is overloaded with traffic.
Solution: Check whether relevant error logs exist on the backend server.
Possible cause 2
A large number of 503 errors appear in the sampling log details of PTS, but no relevant information is found on the backend server. If the following conditions are met in your stress testing scenario, the error is returned by SLB.
An HTTP or HTTPS API is used.
The entry point of the stress testing environment is an SLB instance (Internet-facing SLB instance or internal-facing SLB instance).
The backend service does not return a 503 error and no relevant records can be found.
The 503 error message is the same as the following content:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body bgcolor="white">
<h1>503 Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.</body>
</html>
The source IP addresses that initiate stress testing may be limited. A single IP address triggers the single-proxy throttling of the SLB cluster. Alternatively, the connection of the requesting client is long-connected by default. When the number of IP addresses is small, SLB cannot fully balance loads.
Note
By default, a long connection is established between PTS and your server.
Solution
Use the IP extension feature provided by PTS. For more information, see Start a scenario.
Set the maximum number of virtual users or the requests per second (RPS) to a greater value. For more information, see Configure load models and levels.
On the Scenario Settings page, configure Connection:close
for the request on the Header Definition tab. After the configuration is complete, newly-added APIs use the configuration by default. You can modify the configuration based on your business requirements. 
504 (BadGateway Timeout)
Possible cause
The response from the server attached to the gateway times out.
Solution
Check whether the backend server is providing services as expected. Then, you can extend the timeout period at the gateway or extend the request timeout period of the load generator in the Advanced Settings section of the Create Scenario page.