全部產品
Search
文件中心

API Gateway:錯誤碼表

更新時間:Jul 13, 2024

API Gateway錯誤碼錶。

1. API Gateway錯誤碼錶(VPC執行個體)

本章節的錯誤碼表適用於VPC共用執行個體VPC專享執行個體

  • 當用戶端收到的應答中X-Ca-Error-Code頭不為空白,表示應答碼由API Gateway產生,錯誤碼由一個6位長度的字元描述,請參考下表,而X-Ca-Error-Message表示錯誤的應答資訊,用於描述該情境下更詳細的一些錯誤資訊。

  • 如果X-Ca-Error-Code頭為空白,則表示這個HTTP應答碼由後端服務產生,API Gateway透傳了來自後端的錯誤資訊。

錯誤碼

HTTP狀態代碼

Message

描述

I400HD

400

Invalid Header `${HeaderName}` ${Reason}

HTTP要求標頭非法

I400MH

400

Header `${HeaderName}` is Required

缺少HTTP要求標頭

I400BD

400

Invalid Body: ${Reason}

HTTP請求包體非法

I400PA

400

Invalid Request Path `${Reason}`

HTTP請求路徑非法

I405UM

405

Unsupported Method `${Reason}`

不支援的HTTP要求方法

I400RU

400

Invalid Request Uri `${Reason}`

HTTP請求URL非法

I403PT

403

Invalid protocol ${Protocol} unsupported

使用了API配置中不支援的協議,請檢查API配置的協議

I413RL

413

Request body too Large

請求包體過長,相關限制參考使用限制

I413UL

413

Request URL too Large

請求URL過長,相關限制參考使用限制

I400CT

400

Invalid Content-Type: `${Reason}`

非法的`Content-Type`

I404DO

404

Invalid Domain `${DomainName}`

未知的請求網域名稱,請使用綁定的網域名稱進行調用

I410GG

410

Group's instance invalid

請求了非法的執行個體,分組可能已經不屬於當前執行個體

I400SG

400

Invalid Stage

請求了未知的環境

I404NF

404

API not found ${Reason}

根據請求的`Path`,`Method`在當前的環境中未找到API,請參考I404NF錯誤碼排查

X400PM

400

Invalid plugin meta ${PluginName} ${Reason}

外掛程式中繼資料非法

X500ED

500

Expired api definition

到期的老版本中繼資料已經不被新版本API Gateway支援,需要提交工單修改老版本中繼資料

X500AM

500

Invalid Api Meta, try deploy again or contact us via ticket

儲存的中繼資料定義格式錯誤,需要提交工單修複

X403DG

403

Bad Domain or Group: ${Reason}

分組資料非法

B451DO

451

Unavailable Domain for Legal Reasons

網域名稱因法律法規問題被禁

B451GO

451

Unavailable Group for Legal Reasons

分組因法律法規問題被禁

B403OD

403

Provider Account Overdue

API提供方欠費,若是雲市場購買的API,請聯絡服務位址理

A401AC

401

Invalid AppCode ${Reason}

當使用AppCode模式授權時,未找到AppCode,請核實App是否授權,AppCode是否有誤

A400IK

400

Invalid AppKey

當使用`Key/Secret`簽名授權時,未找到AppKey

A403IS

403

Invalid Signature, Server StringToSign:`${StringToSign}`

簽名不匹配,排查請參考Invalid Signature

A403EP

403

App authorization expired

授權已到期,請重新授權

A403PR

403

Plugin Authorization Needed

需要外掛程式授權

A400MA

400

Need authorization, `X-Ca-Key` or `Authorization: APPCODE ...` is required

需要使用`Key/Secret`簽名授權或`AppCode`授權

I400I5

400

Invalid Content-MD5 ${Reason}

不匹配的`Content-MD5`

I400NC

400

X-Ca-Nonce is required

當設定了`使用X-Ca-Nonce防重放`選項時,必須提供`X-Ca-Nonce`頭

S403NU

403

Nonce Used

檢測到請求重放,請求的`X-Ca-Nonce`頭重複

S403TE

403

X-Ca-Timestamp is expired

`X-Ca-Timestamp`頭中提供的時間戳記已到期,時間戳記有效期間15分鐘

I400MP

400

Parameter `${ParameterName}` is required

API中配置的必填參數未傳值

I400IP

400

Invalid parameter `${ParameterName}` ${Reason}

API中配置的參數值非法

I400JR

400

JWT required

未找到JWT參數

S403JI

403

Claim `jti` is required when `preventJtiReplay:true`

當在`JWT授權外掛程式`中配置了防重放功能時,請求未提供有效`jti`

A403SV

403

Claim `jti` in JWT is used

當在`JWT授權外掛程式`中配置了防重放功能時,請求提供的`jti`已被使用

I400JD

400

JWT Deserialize Failed: `${Token}`

請求中提供的`JWT`解析失敗

A403JT

403

Invalid JWT: ${Reason}

請求中提供的`JWT`非法

A403JK

403

No matching JWK, `${kid}` not found

請求`JWT`中的`kid`沒有匹配的`JWK`

A403JE

403

JWT is expired at `${Date}`

請求中提供的`JWT`已到期

I400JP

400

Invalid JWT plugin config: ${JWT}

`JWT授權`外掛程式配置錯誤

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

當使用預設次層網域訪問時,限制1000次/天,(海外Region及中國香港限制100次/天),請綁定正式網域名稱以解除這個限制

T429IN

429

Throttled by INSTANCE Flow Control

觸發當前執行個體的流控限制,請升級執行個體規格

T429GR

429

Throttled by GROUP Flow Control

觸發當前分組的流控限制,請升級執行個體規格

T429PA

429

Throttled by API Flow Control

觸發外掛程式上的預設API流控

T429PR

429

Throttled by PLUGIN Flow Control

觸發外掛程式的特殊流控

T429SR

429

Throttled by SERVER Flow Control

T429MR

429

Too Many Requests, throttle by `${Description}`

A403IP

403

Access denied by IP Control Policy

被`IP存取控制外掛程式`阻止訪問

A403IN

403

Access from internet is disabled ${Reason}

`API`或`API分組`禁止從公網訪問,請從內網調用,文檔參考私網調用API

A403VN

403

Access from invalid VPC is disabled

來源VPC被阻止

A403AC

403

Access Control Forbidden by ${RuleName}

被`授權控制`外掛程式阻止

A403CO

403

Cross origin resource forbidden ${Domain}

被CORS策略阻止訪問

I404CO

404

Cross origin resource not found ${Method} - ${Path}

根據CORS預檢請求中的Path與Method,無法找到API定義

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

API供應商欠費,請聯絡服務位址理

B403MQ

403

Api Market Subscription quota exhausted

購買的雲市場API配額已耗盡,請續約次數

B403ME

403

Api Market Subscription expired

API訂購關係已到期,請重新訂購

B403MI

403

Api Market Subscription invalid

API市場訂購關係非法

D504RE

504

Backend domain `${Domain}` resolve failed

後端網域名稱解析失敗,請核實後端網域名稱解析

D504IL

504

Backend domain `${Domain}` resolve to illegal address `${Address}`

後端網域名稱解析結果非法

D504CO

504

Backend service connect failed `${Reason}`

後端串連失敗,請檢查安全性群組、後端伺服器啟動狀態、或防火牆配置,排查可參考D504CO錯誤碼排查

504

Backend service connect failed `Connection lease request time out`

API Gateway執行個體後端串連池不夠用導致的後端串連失敗,請升級執行個體規格

D504CS

504

Backend http ssl connect failed `${Reason}`

後端HTTPS串連失敗,請檢查後端配置的協議與連接埠是否匹配

D504TO

504

Backend service request timeout

API Gateway請求後端逾時,請調整後端逾時時間或提高後端服務響應速度

X504VE

504

Backend service vpc mapped failed

後端VPC映射錯誤

D503BB

503

Backend circuit breaker busy

API被斷路器阻止

D503CB

503

Backend circuit breaker open, ${Reason}

API處於熔斷/斷路器開狀態,請檢查後端效能

I508LD

508

Loop Detected

檢測到環回調用

I404DD

404

Device id ${DeviceId} not found

當使用WebSocket雙向通訊調用時,DeviceId未找到

A403FC

403

Function Compute AssumeRole failed ${RequestId}:${Reason}

後端是Function Compute時授權錯誤

D502FC

502

Function Compute response invalid: ${Reason}

後端是Function Compute時,來自後端的應答非法

N502RE

502

Send Response IO Exception: ${Reason}

發送應答給用戶端時報錯,常見於用戶端提前關閉串連或網路錯誤

X500ER

500

Service Internal Error

伺服器內部錯誤,請提交工單聯絡工作人員

X503BZ

503

Service Busy

API Gateway服務忙,請稍後再試

X504TO

504

Service timeout

API Gateway處理逾時,請提交工單聯絡工作人員

部分錯誤碼可能隨著升級或新功能的加入而改變。

2. 管控OpenAPI錯誤碼表

當您調用API Gateway開放的管控OpenAPI時,如CreateAPI、ModifyAPI、DeleteAPI等,您可能遇到以下錯誤碼。

2.1. 服務端錯誤碼

HttpCode為5xx,表示服務不可用。此時建議重試。

錯誤碼

描述

HTTP 狀態代碼

語義

解決方案

ServiceUnavailable

The request has failed due to a temporary failure of the server.

503

服務不可用

建議重試。

InternalError

The request processing has failed due to some unknown error, exception or failure.

500

內部錯誤

建議重試。

2.2. 用戶端錯誤碼

HttpCode為4xx,表示業務錯誤。一般為參數錯誤、許可權限制、商務邏輯錯誤等問題,此時需要仔細查看錯誤碼,並針對性解決問題。

錯誤碼

描述

HTTP 狀態代碼

語義

解決

Repeated%s

The specified %s is repeated.

400

某參數重複(%s 是預留位置,實際調用會給出明確的參數名或提示。)

建議按照提示修改重複的參數後重試。

RepeatedCommit

Resubmit request.

400

請求重複

請不要頻繁提交請求。

Missing%s

The %s is mandatory for this action.

400

缺少參數 %s

根據具體返回補充缺少的參數,重試請求。

MissingAppIdOrAppOwner

AppId or AppOwner must have a valid value.

400

缺少參數 AppId 或者 AppOwner

參數 AppId 和 AppOwner 不能同時為空白。

Invalid%s

The specified parameter %s value is not valid.

400

參數無效

根據返回提示的具體參數,查看相關參數約束,修改後重試。

NotFound%s

Cannot find resource according to your specified %s.

400

找不到資源

根據指定的參數%s找不到資源,建議檢查%s是否正確。

InvalidFormat%s

The specified parameter %s value is not well formatted.

400

參數格式錯誤

建議根據實際返回提示,查看%s的格式要求,修改後重試。

Duplicate%s

The specified parameter %s value is duplicate.

400

參數重複

某請求參數不允許重複,建議檢查修正後重試。

DependencyViolation%s

The specified %s has %s definitions.

400

參數依賴錯誤

指定參數被依賴,不能隨意刪除,請先解除依賴。

Forbidden%s

Not allowed to operate on the specified %s.

403

無權操作/操作禁止

您無權執行該操作。

NoPermission

User is not authorized to operate on the specified resource.

403

無權操作

RAM 鑒權不通過。

ExceedLimit%s

The specified %s count exceeds the limit.

400

超出個數限制

一般指使用者賬戶下建立的 API、API 分組或者APP超出個數限制。

UserNotFound

The specified user can not be found.

404

指定使用者找不到

根據輸入的使用者資訊找不到該使用者。

DomainCertificateNotFound

Cannot find the domain certificate.

400

指定網域名稱認證不存在

建議檢查傳入的認證 ID 及名稱。

DomainNotResolved

The specified domain has not been resolved.

400

指定網域名稱未解析

需要將指定網域名稱 CNAME 解析到分組的次層網域上,才能完成綁定。網域名稱解析是在使用者網域名稱購買的網站上操作。

InvalidICPLicense

The specified domain have not got ICP license, or the ICP license does not belong to Aliyun.

400

網域名稱備案不合格

要綁定的網域名稱需要在阿里雲做首次備案,已經在其他系統做備案的,需要在阿里雲備案接入。備案接入需要擷取備案號,在阿里雲有 ECS 且具有公網 IP 的,每個 ECS 有5個備案號。

Invalid%s.LengthLimit

The parameter %s length exceeds the limit.

400

長度超限

參數%s超出長度限制,建議修正後重試。

InvalidApiDefault

The ApiDefault value exceeds limit.

400

流控外掛程式 API 預設值超過限制值

該值數值不能超過1億,與單位無關。

InvalidAppDefault

The AppDefault value must smaller than the UserDefault and ApiDefault.

400

AppDefault 的值不符合規則

該值需要小於 API 流控值和使用者流控值。

InvalidUserDefault

The UserDefault value must bigger than the AppDefault and smaller than the ApiDefault.

400

UserDefault 的值不符合規則

該值需要小於 API 流控值並大於 APP 流控值。

InvalidParamMapping

Parameters must be fully mapped.

400

參數映射無效

建立 API 時,前後端參數映射需要是全映射。即每個入參都需要配置後端參數名稱。

InvalidOwnerAccount

OwnerAccount is invalid.

400

APP所有者帳號無效

一般為操作授權時,輸入目標使用者的阿里雲郵箱帳號,該帳號無效。建議檢查修正後重試。

ServiceForbidden

Your Gateway service is forbidden by risk control.

400

API Gateway服務被風控(應該使使用者被風控吧)

請注意不要頻繁請求,建議稍後重試。

ServiceUnOpen

Your Gateway service has not been opened.

400

服務未開通

建議到阿里雲官網開通一下 API Gateway服務。

ServiceInDept

Your API Gateway service is in dept.

400

(您的 API Gateway)服務欠費

儲值或者結算後重新開始使用。

EqualSignature

The new signature is the same as the old.

400

新密鑰與舊的相等

修改後端簽名密鑰時,新設定的 Key 和 Secret 不能跟原來的一樣。

CertificateNotMatch

The domain does not match the one in the certificate.

400

認證不匹配

指定網域名稱與認證內網域名稱不匹配。

CertificateKeyNotMatch

The certificate private key does not match the public key.

400

認證密鑰不匹配

認證的公開金鑰和私密金鑰不匹配。

PrivateKeyEncrypted

The certificate private key is encrypted, please upload the unencrypted version.

400

密鑰不能加密

認證私密金鑰加密了,要求上傳不加密的版本。

CertificateSecretKeyError

The certificate private key is invalid.

400

認證私密金鑰錯誤

建議檢查後重新傳入。

InvalidApiServiceAddress

The specified service address is not valid.

400

API 後端服務地址無效

配置的 API 後端服務地址無效。

2.3. 用戶端公用錯誤碼

HttpCode為4xx,調用全阿里雲產品的OpenAPI均可能遇到,表示業務錯誤。一般為請求格式錯誤、請求方式錯誤、必填參數丟失、參數格式錯誤、簽名錯誤、流控限制等問題。此時需查看具體錯誤碼,針對性解決問題。

報錯情境

錯誤碼

錯誤提示

狀態代碼

建議

API 找不到。

InvalidApi.NotFound

Specified api is not found, please check your url and method.

404

請檢查指定的 action 介面名稱是否正確,注意大小寫區分。

缺少必填參數。

Missing{ParameterName}

{ParameterName} is mandatory for this action.

400

指定參數為必填參數,請傳入。

AccessKeyId 找不到

InvalidAccessKeyId.NotFound

Specified access key is not found.

404

請檢查調用時是否傳入正確的 AccessKeyId。

AccessKeyId 被禁用。

InvalidAccessKeyId.Inactive

Specified access key is disabled.

400

檢查 AK 是否可用。

時間戳記格式不對(Date 和 Timestamp)。

InvalidTimeStamp.Format

Specified time stamp or date value is not well formatted.

400

檢查時間戳記。

使用者時間和伺服器時間超過15分鐘。

InvalidTimeStamp.Expired

Specified time stamp or date value is expired.

400

檢查時間戳記。

SignatureNonce 重複

SignatureNonceUsed

Specified signature nonce was used already.

400

傳回值格式不正確。

InvalidParameter.Format

Specified parameter format is not valid.

400

僅支援 XML/JSON。

參數值校正不通過。

Invalid{ParameterName}

Specified parameter {ParameterName} is not valid.

400

請檢查指定參數的值。

Http 要求方法不支援。

UnsupportedHTTPMethod

Specified signature is not matched with our calculation.

400

請檢查請求Method。

簽名方法不支援。

InvalidSignatureMethod

Specified signature method is not valid.

400

預設可以不填寫該值。

簽名不通過。

SignatureDoesNotMatch

Specified signature is not matched with our calculation.

400

簽名不通過。

使用者調用頻率超限。

Throttling.User

Request was denied due to user flow control.

400

請稍後訪問,降低訪問頻率。

API 訪問頻率超限。

Throttling.API

Request was denied due to api flow control.

400

請稍後訪問,降低訪問頻率。

缺少AccessKeyId。

MissingSecurityToken

SecurityToken is mandatory for this action.

400

請檢查是否傳入有效AccessKeyId。