This topic describes the error codes of API Gateway.
1. Error codes for API Gateway instances of the VPC type
The error codes described in this chapter apply to VPC Serverless instances and VPC Dedicated instances.
If the
X-Ca-Error-Codeheader is not empty in a response received by a client, the error code is generated by API Gateway. Such an error code is a six-character string. The following table lists all possible error codes that may be generated by API Gateway. For the detailed error message, refer to theX-Ca-Error-Messageheader.If the
X-Ca-Error-Codeheader is empty, the HTTP status code is generated by a backend service. API Gateway passes through the error information from the backend service.
Error code | HTTP status code | Message | Description |
I400HD | 400 | Invalid Header `${HeaderName}` ${Reason} | Invalid HTTP request header. |
I400MH | 400 | Header `${HeaderName}` is Required | Missing HTTP request header. |
I400BD | 400 | Invalid Body: ${Reason} | Invalid HTTP request body. |
I400PA | 400 | Invalid Request Path `${Reason}` | Invalid HTTP request path. |
I405UM | 405 | Unsupported Method `${Reason}` | Unsupported HTTP request method. |
I400RU | 400 | Invalid Request Uri `${Reason}` | Invalid request URL. |
I403PT | 403 | Invalid protocol ${Protocol} unsupported | The protocol is not supported by the API configuration. Check the protocol settings in the API configuration. |
I413RL | 413 | Request body too Large | The request body is too large. For more information, see Limits. |
I413UL | 413 | Request URL too Large | The request URL is too long. For more information, see Limits. |
I400CT | 400 | Invalid Content-Type: `${Reason}` | Invalid `Content-Type`. |
I404DO | 404 | Invalid Domain `${DomainName}` | Unknown request domain name. Use an attached domain name to make the call. |
I410GG | 410 | Group's instance invalid | An invalid instance was requested. The group may no longer belong to the current instance. |
I400SG | 400 | Invalid Stage | An unknown environment was requested. |
I404NF | 404 | API not found ${Reason} | The API was not found in the current environment based on the requested `Path` and `Method`. For more information, see Troubleshoot the I404NF error code. |
X400PM | 400 | Invalid plugin meta ${PluginName} ${Reason} | Invalid plugin metadata. |
X500ED | 500 | Expired api definition | Expired metadata from an earlier version is not supported by the new API Gateway version. Submit a ticket to modify the old metadata. |
X500AM | 500 | Invalid Api Meta, try deploy again or contact us via ticket | The saved metadata definition is in an incorrect format. Submit a ticket to fix the issue. |
X403DG | 403 | Bad Domain or Group: ${Reason} | Invalid group data. |
B451DO | 451 | Unavailable Domain for Legal Reasons | The domain name is banned for legal reasons. |
B451GO | 451 | Unavailable Group for Legal Reasons | The group is banned for legal reasons. |
B403OD | 403 | Provider Account Overdue | The API provider has an overdue payment. If the API was purchased from Alibaba Cloud Marketplace, contact the service provider. |
A401AC | 401 | Invalid AppCode ${Reason} | When you use the AppCode authorization mode, the AppCode is not found. Verify that the app is authorized and the AppCode is correct. |
A400IK | 400 | Invalid AppKey | When you use Key/Secret signature authorization, the AppKey is not found. |
A403IS | 403 | Invalid Signature, Server StringToSign:`${StringToSign}` | The signature does not match. For troubleshooting information, see Invalid Signature. |
A403EP | 403 | App authorization expired | The authorization has expired. Grant authorization again. |
A403PR | 403 | Plugin Authorization Needed | Plugin authorization is required. |
A400MA | 400 | Need authorization, `X-Ca-Key` or `Authorization: APPCODE ...` is required | Key/Secret signature authorization or AppCode authorization is required. |
I400I5 | 400 | Invalid Content-MD5 ${Reason} | Mismatched `Content-MD5`. |
I400NC | 400 | X-Ca-Nonce is required | If the `Use X-Ca-Nonce for anti-replay` option is enabled, you must provide the `X-Ca-Nonce` header. |
S403NU | 403 | Nonce Used | A request replay was detected. The `X-Ca-Nonce` header is a duplicate. |
S403TE | 403 | X-Ca-Timestamp is expired | The timestamp provided in the `X-Ca-Timestamp` header has expired. The timestamp is valid for 15 minutes. |
I400MP | 400 | Parameter `${ParameterName}` is required | A value was not passed for a required parameter configured in the API. |
I400IP | 400 | Invalid parameter `${ParameterName}` ${Reason} | The value of a parameter configured in the API is invalid. |
I400JR | 400 | JWT required | The JWT parameter was not found. |
S403JI | 403 | Claim `jti` is required when `preventJtiReplay:true` | When the anti-replay feature is configured in the JWT authorization plugin, the request does not provide a valid `jti`. |
A403SV | 403 | Claim `jti` in JWT is used | When the anti-replay feature is configured in the JWT authorization plugin, the `jti` provided in the request has already been used. |
I400JD | 400 | JWT Deserialize Failed: `${Token}` | Failed to parse the JWT provided in the request. |
A403JT | 403 | Invalid JWT: ${Reason} | The JWT provided in the request is invalid. |
A403JK | 403 | No matching JWK, `${kid}` not found | The `kid` in the request JWT does not have a matching JWK. |
A403JE | 403 | JWT is expired at `${Date}` | The JWT provided in the request has expired. |
I400JP | 400 | Invalid JWT plugin config: ${JWT} | The JWT authorization plugin is configured incorrectly. |
A403OL | 403 | OAuth2 Login failed: ${Reason} | |
A403OU | 403 | OAuth2 Get User Info failed: ${Reason} | |
A401OT | 401 | Invalid OAuth2 Access Token | |
A401OM | 401 | OAuth2 Access Token is required | |
T429ID | 429 | Throttled by INNER DOMAIN Flow Control, ${Domain} is a test domain, only 1000 requests per day | When you access the service using the default second-level domain name, the number of calls is limited to 1,000 per day (100 per day for regions outside China and in China (Hong Kong)). Attach a formal domain name to remove this limit. |
T429IN | 429 | Throttled by INSTANCE Flow Control | The throttling limit for the current instance was triggered. Upgrade the instance type. |
T429GR | 429 | Throttled by GROUP Flow Control | The throttling limit for the current group was triggered. Upgrade the instance type. |
T429PA | 429 | Throttled by API Flow Control | The default API throttling limit on the plugin was triggered. |
T429PR | 429 | Throttled by PLUGIN Flow Control | The special throttling limit of the plugin was triggered. |
T429SR | 429 | Throttled by SERVER Flow Control | |
T429MR | 429 | Too Many Requests, throttle by `${Description}` | |
A403IP | 403 | Access denied by IP Control Policy | Access was denied by the IP access control plugin. |
A403IN | 403 | Access from internet is disabled ${Reason} | The API or API group cannot be accessed from the public network. Invoke the API from a private network. For more information, see Invoke an API from a private network. |
A403VN | 403 | Access from invalid VPC is disabled | The source VPC is blocked. |
A403AC | 403 | Access Control Forbidden by ${RuleName} | Access was denied by the authorization control plugin. |
A403CO | 403 | Cross origin resource forbidden ${Domain} | Access was denied by the CORS policy. |
I404CO | 404 | Cross origin resource not found ${Method} - ${Path} | The API definition cannot be found based on the Path and Method in the CORS preflight request. |
I404CH | 404 | Content not cached, with `Cache-Control:only-if-cached` | |
I404NR | 404 | ${Resource} not found | |
I404SR | 404 | Stage route missing: ${Reason} | |
B403MO | 403 | Api Market Subscription overdue | The API provider has an overdue payment. Contact the service provider for assistance. |
B403MQ | 403 | Api Market Subscription quota exhausted | The purchased Alibaba Cloud Marketplace API quota is exhausted. Renew the number of calls. |
B403ME | 403 | Api Market Subscription expired | The API subscription has expired. Subscribe to the API again. |
B403MI | 403 | Api Market Subscription invalid | The API Marketplace subscription is invalid. |
D504RE | 504 | Backend domain `${Domain}` resolve failed | Failed to resolve the backend domain name. Verify the backend domain name resolution. |
D504IL | 504 | Backend domain `${Domain}` resolve to illegal address `${Address}` | The backend domain name was resolved to an invalid address. |
D504CO | 504 | Backend service connect failed `${Reason}` | Failed to connect to the backend service. Check the security group settings, the startup status of the backend server, and the firewall configuration. For troubleshooting information, see Troubleshoot the D504CO error code. |
504 | Backend service connect failed `Connection lease request time out` | Failed to connect to the backend service because the backend connection pool of the API Gateway instance is insufficient. Upgrade the instance type. | |
D504CS | 504 | Backend http ssl connect failed `${Reason}` | Failed to establish an HTTPS connection to the backend service. Check whether the configured protocol and port of the backend service match. |
D504TO | 504 | Backend service request timeout | The request to the backend service timed out. Adjust the backend timeout period or improve the response speed of the backend service. |
X504VE | 504 | Backend service vpc mapped failed | Incorrect backend VPC mapping. |
D503BB | 503 | Backend circuit breaker busy | The API call was blocked by the circuit breaker. |
D503CB | 503 | Backend circuit breaker open, ${Reason} | The API is in the circuit breaking state (the circuit breaker is open). Check the performance of the backend service. |
I508LD | 508 | Loop Detected | A loop call was detected. |
I404DD | 404 | Device id ${DeviceId} not found | When you use WebSocket for bidirectional communication, the DeviceId is not found. |
A403FC | 403 | Function Compute AssumeRole failed ${RequestId}:${Reason} | An authorization error occurred when the backend service is Function Compute. |
D502FC | 502 | Function Compute response invalid: ${Reason} | When the backend service is Function Compute, the response from the backend is invalid. |
N502RE | 502 | Send Response IO Exception: ${Reason} | An error occurred when sending the response to the client. This is often caused by the client closing the connection prematurely or a network error. |
X500ER | 500 | Service Internal Error | An internal server error occurred. Submit a ticket to contact technical support. |
X503BZ | 503 | Service Busy | API Gateway is busy. Try again later. |
X504TO | 504 | Service timeout | API Gateway timed out. Submit a ticket to contact technical support. |
Specific error codes may change when the service is updated or new features are added.
2. Error codes for API operation management
When you call API operations provided by API Gateway, such as CreateAPI, ModifyAPI, and DeleteAPI, error codes that are listed in the following sections may be reported.
2.1 Error codes for servers
The reported HTTP status code is 5XX, which indicates that services are unavailable. In this case, we recommend that you try again later.
Error code | Description | HTTP status code | Semantics | Solution |
ServiceUnavailable | The request has failed due to a temporary failure of the server. | 503 | The service is unavailable. | Try again later. |
InternalError | The request processing has failed due to some unknown error, exception or failure. | 500 | Internal fault | Try again later. |
2.2 Error codes for clients
The reported HTTP status code is 4XX, which indicates a business error. A business error can be a parameter error, an error caused by access control, or a business logic error. Carefully view error information before you troubleshoot issues.
Error code | Description | HTTP status code | Semantics | Solution |
Repeated%s | The specified %s is repeated. | 400 | Duplicate parameter (%s is a placeholder for the specific parameter name or a message.) | Change the parameter value and try again. |
RepeatedCommit | Resubmit request. | 400 | Duplicate request | Do not repeatedly submit the same request. |
Missing%s | The %s is mandatory for this action. | 400 | The %s parameter is missing. | Add the missing parameters specified in the response and retry the request. |
MissingAppIdOrAppOwner | AppId or AppOwner must have a valid value. | 400 | The error message returned because the AppId or AppOwner parameter is not specified. | Specify the AppId or AppOwner parameter, or both of them. |
Invalid%s | The specified parameter %s value is not valid. | 400 | Invalid parameter | View the requirements on the specified parameter, modify the parameter, and then try again. |
NotFound%s | Cannot find resource according to your specified %s. | 400 | The resource was not found. | Check whether the %s parameter is correctly specified. |
InvalidFormat%s | The specified parameter %s value is not well formatted. | 400 | The error message returned because the parameter format is invalid. | View the requirements on the format of the value of the %s parameter, modify the parameter value, and then try again. |
Duplicate%s | The specified parameter %s value is duplicate. | 400 | Duplicate parameter | The request parameter is duplicated. Correct the request and retry. |
DependencyViolation%s | The specified %s has %s definitions. | 400 | Parameter dependency error | Remove the dependency. A parameter on which other parameters depend cannot be deleted. To delete such a parameter, remove the dependency first. |
Forbidden%s | Not allowed to operate on the specified %s. | 403 | Unauthorized operation | You do not have permission to execute this operation. |
NoPermission | User is not authorized to operate on the specified resource. | 403 | Unauthorized operation | RAM authentication failed. |
ExceedLimit%s | The specified %s count exceeds the limit. | 400 | The number limit has been exceeded. | This error indicates that the number of APIs, API groups, or apps in your account has exceeded the limit. |
UserNotFound | The specified user can not be found. | 404 | The specified user was not found. | The specified user was not found. |
DomainCertificateNotFound | Cannot find the domain certificate. | 400 | The error message returned because the certificate for the specified domain name does not exist. | Check the ID and name of the uploaded certificate. |
DomainNotResolved | The specified domain has not been resolved. | 400 | The error message returned because the specified domain name is not resolved. | Bind a specific CNAME record to the second-level domain name of the API group. Domain name resolution is performed by the domain name registrar from which you purchase the domain name. |
InvalidICPLicense | The specified domain have not got ICP license, or the ICP license does not belong to Aliyun. | 400 | Domain name ICP filing failure | Apply for an ICP filing for the domain name in Alibaba Cloud ICP Filing System. If you have applied for an ICP filing for the domain name in other systems, you must add Alibaba Cloud as a service provider to the ICP filing. To apply for an ICP filing, you must obtain a service identification number. Each Alibaba Cloud Elastic Compute Service (ECS) instance with a public IP address provides five service identification numbers. |
Invalid%s.LengthLimit | The parameter %s length exceeds the limit. | 400 | The length limit is exceeded. | The %s parameter exceeds the length limit. Please correct the value and retry. |
InvalidApiDefault | The ApiDefault value exceeds limit. | 400 | The default value of the throttle plugin API exceeds the limit. | The value must not exceed 100 million, regardless of the unit. |
InvalidAppDefault | The AppDefault value must smaller than the UserDefault and ApiDefault. | 400 | The value of AppDefault violates the rule. | This value must be less than the API and user throttle values. |
InvalidUserDefault | The UserDefault value must bigger than the AppDefault and smaller than the ApiDefault. | 400 | The value of UserDefault does not conform to the rule. | This value must be between the APP throttle value and the API throttle value. |
InvalidParamMapping | Parameters must be fully mapped. | 400 | The parameter mapping is invalid. | Specify a backend parameter for each request parameter. When you create an API, map each request parameter to a backend parameter. |
InvalidOwnerAccount | OwnerAccount is invalid. | 400 | The error message returned because the account of the app owner is invalid. | When you grant permissions for an operation, the Alibaba Cloud mailbox account you specify for the target user might be invalid. We recommend that you verify and correct the account before you retry. |
ServiceForbidden | Your Gateway service is forbidden by risk control. | 400 | The user's access to the API Gateway service is blocked by risk control. | Do not send many requests in a short time. Try again later. |
ServiceUnOpen | Your Gateway service has not been opened. | 400 | The service has not been activated. | Activate API Gateway on the Alibaba Cloud International site. |
ServiceInDept | Your API Gateway service is in dept. | 400 | Payment for your API Gateway service is overdue. | Service will resume after you top up your account or settle your payment. |
EqualSignature | The new signature is the same as the old. | 400 | The new key is the same as the legacy key. | Modify the backend signature key. Make sure that the newly configured key-secret pair is different from the previous one. |
CertificateNotMatch | The domain does not match the one in the certificate. | 400 | Certificate mismatch | The specified domain name does not match the domain name in the certificate. |
CertificateKeyNotMatch | The certificate private key does not match the public key. | 400 | The error message returned because the public and private keys in the certificate do not match. | The public key of the certificate does not match the private key. |
PrivateKeyEncrypted | The certificate private key is encrypted, please upload the unencrypted version. | 400 | The key cannot be used for encryption. | The certificate private key is encrypted. You must upload an unencrypted version. |
CertificateSecretKeyError | The certificate private key is invalid. | 400 | The error message returned because the private key of the certificate is invalid. | Please check the input and submit it again. |
InvalidApiServiceAddress | The specified service address is not valid. | 400 | The API's backend service endpoint is invalid. | The configured service endpoint for the API backend is invalid. |
2.3 Common error codes for clients
The reported HTTP status code is 4XX, which indicates a business error and may be reported when you call APIs of Alibaba Cloud services. The business error can be an invalid request format, an incorrect request method, missing required parameters, an invalid parameter value format, an invalid signature, or an error due to throttling. Carefully view error information before you troubleshoot issues.
Error Scenarios | Error code | Error message | Status code | Recommendations |
The specified API cannot be found. | InvalidApi.NotFound | Specified api is not found, please check your url and method. | 404 | Check whether the specified API operation name is valid. The name is case-sensitive. |
A required parameter is not specified. | Missing{ParameterName} | {ParameterName} is mandatory for this action. | 400 | Specify the required parameter. |
The AccessKey ID cannot be found. | InvalidAccessKeyId.NotFound | Specified access key is not found. | 404 | Check whether a valid AccessKey ID is used when you call the API. |
The AccessKey ID is disabled. | InvalidAccessKeyId.Inactive | Specified access key is disabled. | 400 | Check whether the AccessKey pair is available. |
The format of the date or timestamp is invalid. | InvalidTimeStamp.Format | Specified time stamp or date value is not well formatted. | 400 | Check the timestamp. |
The difference between the client time and server time exceeds 15 minutes. | InvalidTimeStamp.Expired | Specified time stamp or date value is expired. | 400 | Check the timestamp. |
The SignatureNonce value has been used. | SignatureNonceUsed | Specified signature nonce was used already. | 400 | |
The returned parameter value is in an invalid format. | InvalidParameter.Format | Specified parameter format is not valid. | 400 | Only XML and JSON formats are supported. |
The parameter value verification failed. | Invalid{ParameterName} | Specified parameter {ParameterName} is not valid. | 400 | Check the parameter value. |
The HTTP request method is not supported. | UnsupportedHTTPMethod | Specified signature is not matched with our calculation. | 400 | Check the request method. |
The signature method is not supported. | InvalidSignatureMethod | Specified signature method is not valid. | 400 | By default, this value can be left blank. |
The signature verification failed. | SignatureDoesNotMatch | Specified signature is not matched with our calculation. | 400 | Signature verification failed. |
The user-level call frequency exceeds the threshold. | Throttling.User | Request was denied due to user flow control. | 400 | Reduce the call frequency. |
The API-level call frequency exceeds the threshold. | Throttling.API | Request was denied due to api flow control. | 400 | Please reduce your access frequency and try again later. |
The AccessKey ID is missing. | MissingSecurityToken | SecurityToken is mandatory for this action. | 400 | Check whether you specified a valid AccessKey ID. |