错误码
更新时间:2024-07-25
错误码说明
本文主要介绍推理服务API对应的错误码及其错误描述。在调用API请求后,可以通过返回的错误码、错误信息及排查建议等进行问题排查。
数据结构
若请求错误,服务器将以JSON格式返回错误信息,错误信息包含:
- error_code:错误码。
- error_msg:错误描述信息,帮助理解和解决发生的错误。
错误示例
例如Access Token失效返回:
{
"error_code": 110,
"error_msg": "Access token invalid or no longer valid"
}
错误码列表
大模型能力相关
错误码 | 错误信息 | 说明及排查建议 |
1 | Unknown error | 【系统内部错误】服务器内部错误,请再次请求, 如果持续出现此类错误,请在百度云控制台内提交工单反馈。 |
2 | Service temporarily unavailable | 【系统内部错误】服务暂不可用,请再次请求, 如果持续出现此类错误,请在百度云控制台内提交工单反馈。 |
3 | Unsupported openapi method | 【用户输入错误】调用的API不存在,请检查后重新尝试。 |
4 | Open api request limit reached | 【系统内部错误】集群超限额,请再次请求,如果持续出现此类错误,请在百度云控制台内提交工单反馈。 |
request limit by resouce cluster reached | ||
6 | No permission to access data | 【鉴权错误】app无权限访问服务。 定制服务:检查定制服务是否处于【已发布】状态,定制服务发布成功以后会自动授权。 插件服务:请为在应用接入为应用配置插件服务的权限。 |
13 | Get service token failed | 【鉴权错误】获取token失败。 |
14 | IAM Certification failed | 【鉴权错误】IAM鉴权失败。 |
15 | app not exists or create failed | 应用不存在或者创建失败。 重试调用可解决问题。 |
17 | Open api daily request limit reached | 【用户配额超限】如果是付费接口,可能是付费接口未开通付费,或者当前账户已欠费,请在控制台计费管理开通计费,或者检查账户余额。如果是免费接口,免费接口每天请求量超限额。 |
18 | Open api qps request limit reached | 【用户配额超限】QPS超限额。 |
qps request limit by APP ID reached | ||
19 | Open api total request limit reached | 免费接口,请求总量超限额 |
100 | Invalid parameter | 【鉴权错误】无效的access_token参数,请检查后重新尝试。 |
110 | Access token invalid or no longer valid | 【鉴权错误】access_token无效。 |
111 | Access token expired | 【鉴权错误】access token过期。 |
200 | InternalError | 服务错误,模板不存在。 |
336000 | Internal error | 【系统内部错误】服务内部错误,请稍后重试。 |
336001 | Invalid Argument | 【用户输入错误】入参格式有误,比如缺少必要参数。 |
336002 | Invalid JSON | 【用户输入错误】入参body不是标准的JSON格式。 |
336003 | source in custom_request can not be empty | 【用户输入错误】custom_request中source中参数不能为空。 |
custom_request must be json string | 【用户输入错误】custom_request 必须是json格式。 | |
the length of session_id cann't be greater then 36 | 【用户输入错误】session_id长度不能超过36。 | |
session_id cann't be 0 | 【用户输入错误】session_id不能为0。 | |
the format of session_id is invaild | 【用户输入错误】session_id格式无效。 | |
field system too long | 【用户输入错误】字段system长度过长。 | |
message content can not be empty | 【用户输入错误】入参中content的值不能为空。 | |
parameter check failed, temperature range is (0, 1.0] | 【用户输入错误】入参错误,temperature的范围是[0-1.0]。 | |
parameter check failed, top_p range is [0, 1.0] | 【用户输入错误】入参错误,top_p的范围是[0-1.0]。 | |
parameter check failed, penalty_score range is [1.0, 2.0] | 【用户输入错误】入参错误,penalty_score 的范围是[1.0-2.0]。 | |
The Name field cannot be empty if the role field is function | 【用户输入错误】如果role为function,则name不能为空。 | |
function_call's name can't be blank | 【用户输入错误】function_call的name不能为空。 | |
functions name can't be blank | 【用户输入错误】functions的name不能为空。 | |
functions description can't be blank | 【用户输入错误】functions的description不能为空。 | |
functions parameters can't be blank | 【用户输入错误】functions的parameters不能为空。 | |
prompt len invalid, len xxx | 【用户输入错误】prompt无效,当前输入长度... | |
optType is invalid, optType:xxx | 【用户输入错误】optType无效。 | |
the content of current query can not be blank | 当前query的内容不能为"\n", "\r"等空白字符 | |
embeddings max input length is 16 | 【用户输入错误】请检查参数input文本数量,不能超过16 | |
prompt tokens too long | 【用户输入错误】请求内容超过大模型内部限制 | |
其他情况,请查看返回的具体说明 | 用户输入参数错误,error_msg中会给出具体的说明 | |
336004 | appid:xxx have not enable trace permission | 权限控制出错。 |
336005 | API name not exist | 【用户输入错误】定制化模型服务apiname不存在。 |
336006 | the length of messages must be an odd number | 【用户输入错误】messages数组长度必须为奇数。 |
the role of message with even index in the messages must be user or function | 【用户输入错误】message入参列表中,索引为偶数的role的值必须是“user”或者“function” | |
the role of message with odd index in the messages must be assistant | 【用户输入错误】message入参列表中,索引为奇数的role的值必须是“assistant” | |
336007 | prompt can not be empty | 请求不能为空 |
the max input characters is xxx | 请求长度不能超过最大字符限制 | |
336008 | functioncall相关参数用户输入错误的具体说明 | functioncall功能用户输入错误,如total size cannot larger then xxx,表示总长度不能超过xxx个字符 |
336100 | Internal error | 【系统内部错误】服务内部错误,请稍后重试。 |
336101 | Invalid HTTP Method | 【用户输入错误】非法的HTTP Method, 当前仅支持POST请求 |
336102 | user_id can not be empty | 【用户输入错误】user_id字段未设置 |
336103 | Prompt tokens too long | 【用户输入错误】请求内容超过大模型内部限制 |
336104 | system is invalid | 【用户输入错误】system内容不合法 |
336105 | user is invalid | user_setting内容不合法 |
336106 | the content of functions field is invalid | function内容不合法 |
336110 | Plugin not exist | 插件不存在 |
336111 | Invalid plugin extra_data | 插件extra_data 反序列化失败 |
336112 | plugin extra_data too long | 插件plugin_header超出长度限制 |
336113 | 由插件开发者自己定义,千帆透传错误描述 | 插件服务用户输入错误 |
336114 | plugin unsupported | 插件未对千帆开放 |
336115 | unsupported authentication type | 插件鉴权类型不支持 |
336116 | number of plugins exceed 3 | 插件超过预定数量 |
336117 | plugin system request limit reached | 插件系统承载不足 |
336120 | tokenizer interanl error | tokenizer服务内部错误 |
336121 | unknown tokenizer | 未知的tokenizer类型 |
336122 | tokenizer input prompt too long | tokenizer输入字符过长 |
336123 | unknown model name | 未知的模型入参 |
336200 | Embeddings internal error | 【系统内部错误】Embeddings服务内部错误 |
336210 | PromptOpt internal error | Prompt优化服务内部错误 |
336211 | PromptOpt input illegal | Prompt优化服务输入内容不合法 |
336212 | PromptOpt output illegal | Prompt优化服务输出内容不合法 |
336220 | Reranker internal error | Reranker服务内部错误 |
336221 | Reranker接口用户输入错误的具体说明 | 用户输入参数错误,error_msg中会给出具体的说明 |
336300 | inner error | 文生图内部错误 |
336301 | text2image service is busy,please control request concurrency | 文生图服务超时 |
336302 | Text2Image input illegal | 文生图输入文审不安全 |
336303 | Text2Image output illegal | 文生图输出图审不安全 |
336304 | Chinese translation error, please try again or change to English input | 文生图中文翻译失败 |
336310 | inner error | 图生文内部错误 |
336311 | image2text input image illegal | 图生文输入图审不安全 |
invalid image | 输入图片图生文模型无法接受 | |
336501 | Rate limit reached for RPM | Cloud ID下RPM超限额,请在百度云控制台内提交工单反馈。 |
336502 | Rate limit reached for TPM | Cloud ID下TPM超限额,请在百度云控制台内提交工单反馈。 |
336503 | Rate limit reached for scramble resource | 混抢资源qps超限,包含可抢占接口、离线推理、离线评估请求。 |
337006 | 缺少必要参数 | * 【用户输入错误】未找到llm相关参数->插件应用模型AK/SK无效,无法获取access_token
* 【用户输入错误】未找到工具相关参数->缺少插件相关参数或参数配置不正确。 |
337008 | 插件id输入错误 | 一般指插件id输入错误,如插件id超过3个可能会引起此错误 |
337009 | 插件请求错误 | 请参考error_msg信息和信息中的错误码进行排查。 |
IAM认证相关
HTTP状态码 | 错误码 | 错误信息 | 错误描述 |
400 | InappropriateJSON | The JSON you provided was well-formed and valid, but not appropriate for this operation. | 请求中的JSON格式正确,但语义上不符合要求。如缺少某个必需项,或值类型不匹配等。 |
400 | InvalidMarker | The marker you provided was invalid. | 请求的marker不合法。 |
400 | SignatureDoesNotMatch | The request signature we calculated does not match the signature you provided. Check yourSecret Access Key and signing method. Consultthe service documentation for details. | Authorization头域中附带的签名和服务端验证不一致。 |
400 | RequestExpired | Request has expired. Timestamp date is . | 请求超时。要改成x-bce-date。若请求中只有Date,需将Date转成datetime。 |
400 | InvalidHTTPAuthHeader | The Access Key ID you provided does notexist in our records. | Authorization头域格式错误。 |
400 | InvalidHTTPRequest | There was an error in the body of your HTTP request. | HTTP body格式错误。例如不符合指定的Encoding等。 |
400 | InvalidURI | Could not parse the specified URI. | URI形式不正确。例如一些服务定义的关键词不匹配等。对于ID不匹配的问题,应定义更加具体的错误码,如NoSuchKey。 |
400 | MalformedJSON | The JSON you provided was not well-formed. | JSON格式不合法。 |
403 | AccessDenied | Access denied. | 无权限访问对应的资源。 |
403 | IdempotentParameterMismatch | The request uses the same client token asa previous, but non-identical request. | clientToken对应的API参数不一样。 |
403 | InvalidAccessKeyId | The Access Key ID you provided doesnot exist in our records. | Access Key ID不存在。 |
403 | OptInRequired | A subscription for the service is required. | 没有开通对应的服务。 |
404 | InvalidVersion | The API version specified was invalid. | URI的版本号不合法。 |
500 | InternalError | We encountered an internal error Please try again. | 所有未定义的其他错误。在有明确对应的其他类型的错误时(包括通用的和服务自定义的)不应该使用。 |
批量预测
错误码 | 错误信息 | 错误描述 |
---|---|---|
TaskNameExisted | The name of task you provided has existed. | 批量预测任务名称已存在 |
UnsupportedEndpoint | The endpoint of task you provided is not supported. | 提供的任务endpoint不被支持 |
NoOpenedBilling | No related billing items have been opened. | 未开通相关计费项,不可创建批量预测任务 |
TaskRunningNumberExceedLimit | The number of running tasks has exceeded the limit. | 用户处于运行中的批量任务数量超过最大值5 |
BosUriNotExist | The inputBosUri or outputBosUri you provided does not exist. | 所提供的inputBosUri或outputBosUri不存在 |
BosUriNotDirectory | The inputBosUri or outputBosUri you provided is not a directory. | 所提供的inputBosUri或outputBosUri不是一个目录 |
FileSizeExceedLimit | The total size of all files in the inputBosUri exceeds the 300M limit. | inputBosUri目录下所有文件累计大小超过300M |
InputBosUriEmpty | There are no files in the inputBosUri. | inputBosUri目录下没有文件 |
FileNumExceedLimit | The number of files in the inputBosUri exceeds the 100 limit. | inputBosUri目录下文件数超过100个 |
ParamConfigInvalid | Either endpoint or modelId must be set, but not both. | endpoint和modelId两参数有且只能有一个 |
ModelNotSupport | The model you provided does not support batch inference. | 提供的模型不支持批量预测 |
ModelConfigOffline | The model you provided has been taken offline, and no longer supports batch inference. | 提供的模型已下线,不支持批量预测 |
ModelNotImported | The model is currently being imported, please create task after successful import. | 模型正在导入过程中,请导入成功以后再发起批量推理任务 |