本文介绍API请求发生错误时的公共错误码。
当API请求发生错误时,服务端会返回错误信息,包括HTTP状态码和响应Body中的具体错误细节。其中响应Body中的错误细节使用Protocol Buffers编码,使用如下消息定义:
message Error {
int32 StatusCode = 1;
string ErrorCode = 2;
string ErrorMessage = 3;
string RequestId = 4;
}
在服务端返回的错误信息中,适用于大部分API接口,但存在部分错误信息为某些API所独有的情况。下表描述API错误响应信息中的通用错误码,它们会在多个API错误响应信息中出现。每个API所独有的错误码会在对应API文档中单独描述。
HTTP状态码 | 错误码 | 错误消息 | 描述 |
---|---|---|---|
400 | InvalidParam | The Param Date is invalid. | 请求头中Date的值不符合RFC 1123标准。请您检查请求头,确认Date取值符合RFC 1123标准。 |
400 | InvalidApiVersion | The ApiVersion "<apiversion value>" is invalid. | 请求头缺少x-kms-apiversion。请您检查请求头,确认存在x-kms-apiversion。 |
400 | MissingParameter | Parameter x-kms-acccesskeyid does not exist in http header or body. | 没有在Authorization头部提供AccessKey ID。请检查请求头,确认Authorization头部存在AccessKey ID。 |
400 | InvalidParam | The Param x-kms-signaturemethod is invalid. | 没有提供HTTP请求头x-kms-signaturemethod。请您检查请求头,确认存在x-kms-signaturemethod。 |
400 | InvalidParam | The Param x-kms-signaturemethod is invalid. message:"<signaturemethod value>". | 不支持x-kms-signaturemethod头部指定的签名方法。请您检查请求头,确认支持的签名方法。 |
400 | RequestTimeTooSkewed | Request time exceeds server time more than 15 minutes. | 请求的发送时间超过当前服务处理时间前后15分钟的范围。 |
400 | InvalidApiName | The ApiName "<apiname>" is invalid. | API名称错误。 |
401 | SignatureNotMatch | Signature is not matched. | 请求的数字签名不匹配。请您重试或更换AccessKey后重试。 |
404 | Unauthorized | The AccessKey ID "<accessKeyId>" does not exist in our records. | AccessKey ID不存在。请检查您的AccessKey ID,重新获取后再发起请求。 |
403 | Forbidden.NoPermission | This operation for "<parameter name>" is forbidden by permission system. | 操作无权限。 |
404 | Forbidden.KeyNotFound | The key Key ID or Alias does not exist in the system. | 密钥不存在。 |
404 | Forbidden.KeyNotFound | The key Key ID or Alias does not exist in the key store "<parameter name>". | 密钥不在KMS中。 |
409 | Rejected.State | The request was rejected cause the key state is State. | 密钥不可用。 |
409 | Rejected.PendingDeletion | The request was rejected because the key state is PendingDeletion. | 密钥状态为待删除。 |
409 | Rejected.Disabled | The request was rejected because the key state is Disabled. | 密钥状态为禁用。 |
409 | Rejected.PendingImport | The request was rejected because the key state is PendingImport. | 密钥状态为待导入。 |
415 | InvalidContentType | Content-Type "<type>" is unsupported. | 不支持该类型的Content-Type。 |
500 | InternalFailure | Internal Failure. | 服务器内部错误,请稍后重试。 |
503 | ServiceUnavailableTemporary | Service Unavailable Temporary. | 服务暂时不可用,请稍后重试。 |