API 业务错误码、错误原因与排查说明
本页汇总常见业务错误码及处理建议,按错误类型分节。错误码可由多个接口复用,具体触发条件、响应结构与调用结果的判定方式以对应接口的说明为准。
同一
先根据业务
排查问题或联系支持时,请提供
code 可能对应多种原因,请结合 message 定位。下表列出典型场景及对应的响应体 status_code,不是传输层 HTTP 状态码;场景和 message 不代表该错误码仅适用于某个接口。
表中动态标识、下标及配置值为示例,实际响应以当前请求为准。
参数错误
| code | status_code | 场景示例 | message |
|---|---|---|---|
InvalidParameter | 400 | agent_id 与 pipeline_id_list 均未提供有效值 | Agent application not found. |
InvalidParameter | 400 | 服务不是知识检索场景 | Agent application scene must be search |
InvalidParameter | 400 | 服务配置缺失 | Agent application config is invalid |
InvalidParameter | 400 | query 超长度上限 | Parameter(query) exceeds the limit of (4500 bytes) |
InvalidParameter | 400 | 向量检索缺少查询文本,且无可用的图片检索知识库 | Required parameter(query) missing or invalid, please check the request parameters. Query is required when the query is not a pure image search.. |
InvalidParameter | 400 | Wiki 检索的 query 缺失或为空串 | Required parameter(query) missing or invalid, please check the request parameters. Query is required for wiki retrieval.. |
InvalidParameter | 400 | images 超项数上限 | Parameter(image_list) exceeds the limit of (10) |
InvalidParameter | 400 | 检索的知识库数量超项数上限 | Parameter(pipeline_id_list) exceeds the limit of (15) |
InvalidParameter | 400 | file_id_list 超项数上限 | Parameter(file_id_list) exceeds the limit of (10) |
InvalidParameter | 400 | Wiki 检索传入非空 file_id_list | Required parameter(file_id_list) missing or invalid, please check the request parameters. file_id_list is not supported for wiki retrieval.. |
InvalidParameter | 400 | kb_search_configs 元素的 id 缺失或为空白 | Required parameter(kb_search_configs[0].id is required) missing or invalid, please check the request parameters. |
InvalidParameter | 400 | id 不属于服务绑定的知识库 | Required parameter(kb not bound to agent: kb_xxx) missing or invalid, please check the request parameters. |
InvalidParameter | 400 | id 重复 | Required parameter(duplicate kb id in kb_search_configs: kb_xxx) missing or invalid, please check the request parameters. |
InvalidParameter | 400 | 合并后的 search_filters 超长度上限 | Required parameter(search_filters) missing or invalid, please check the request parameters. pipeline_configs.kb_xxx.search_filters total bytes must less than 80000. |
InvalidParameter | 400 | 非结构化知识库的 tags 超项数上限 | Required parameter(search_filters[0].tags) missing or invalid, please check the request parameters. pipeline_configs.kb_xxx.search_filters[0].tags array size must not exceed 1000. |
InvalidParameter | 400 | Wiki 检索使用不支持的过滤字段 | Required parameter(search_filters) missing or invalid, please check the request parameters. Wiki search_filters contains invalid key 'tags'. Allowed: [page_type, folder_id, category_path]. |
InvalidParameter | 400 | Agent 列表的 agent_scene 缺失 | Required parameter(agent_scene is empty error) missing or invalid, please check the request parameters. |
InvalidParameter | 400 | Agent 列表的 agent_scene 取值非法 | Required parameter(agent_scene is invalid error) missing or invalid, please check the request parameters. |
InvalidParameter | 400 | Agent 列表的 search_type 取值非法 | Required parameter(search_type must be one of: chunk, wiki) missing or invalid, please check the request parameters. |
InvalidParameter | 400 | 创建知识库时 knowledgeType 与 knowledgeScene 只传了一个 | Invalid parameter: knowledgeType and knowledgeScene cannot be empty |
InvalidParameter | 400 | 创建知识库时 knowledgeType 与 structureType 不匹配 | Invalid parameter: knowledgeType and structureType do not match |
InvalidParameter | 400 | 创建知识库时 knowledgeScene 不属于该 knowledgeType | Invalid parameter: knowledgeType and knowledgeScene do not match |
InvalidParameter | 400 | 极速问答的 sinkType 不是 BUILT_IN | Invalid parameter: Lite Rag only supports BUILT_IN sink type |
InvalidParameter | 400 | 图片问答或视觉理解场景的多模态向量模型缺失或非法 | Invalid parameter: invalid multi embedding model |
DocEmptyError | 400 | 创建知识库并导入时 docIds 为空或文件 ID 不存在 | fetch empty doc list from data center. |
InvalidParameter | 400 | 开启时 wiki_auto_update 缺失或不为 true | Required parameter(wiki_auto_update) missing or invalid, please check the request parameters. must be true. |
WikiConfigInvalid | 400 | 开启时整个 extraction 组缺失 | wiki_config parameter(extraction) is invalid: required |
WikiConfigInvalid | 400 | 开启时 synthesis_model_id 缺失或为空白 | wiki_config parameter(synthesis_model_id) is invalid: required |
WikiConfigInvalid | 400 | 修改配置时 synthesis_model_id 为空白 | wiki_config parameter(synthesis_model_id) is invalid: must not be blank |
WikiConfigInvalid | 400 | synthesis_model_id 不在候选清单内 | wiki_config parameter(synthesis_model_id) is invalid: not in the whitelist |
WikiConfigInvalid | 400 | extraction_granularity 取值非法 | wiki_config parameter(extraction_granularity) is invalid: must be one of focused / standard / exhaustive |
WikiConfigInvalid | 400 | content_instructions 超长度上限 | wiki_config parameter(content_instructions) is invalid: length must not exceed 4000 characters |
WikiConfigInvalid | 400 | extraction_instructions 超长度上限 | wiki_config parameter(extraction_instructions) is invalid: length must not exceed 4000 characters |
鉴权错误
| code | status_code | 场景示例 | message |
|---|---|---|---|
InvalidApiKey | 401 | API Key 无效或缺失 | Invalid API-key provided. |
服务开通与计费
| code | status_code | 场景示例 | message |
|---|---|---|---|
ServiceStatusInvalid | 401 | 服务未开通或账单异常 | index service status is invalid. please check your bill info. |
BailianIndexServiceNotOpen | 400 | 知识库服务未开通 | Bailian Knowledge Base service is not activated. |
BailianIndexServiceOutOfCredit | 400 | 知识库服务欠费 | Bailian Knowledge Base service is out of credit. |
Agent 服务错误
| code | status_code | 场景示例 | message |
|---|---|---|---|
RagAgentNotExist | 400 | 未指定版本,且服务未发布 | Agent application not published. |
RagAgentNotExist | 400 | 指定的服务版本不存在 | Agent application not found. |
RagAgentGroupNotExist | 400 | Agent 服务不存在 | Agent application not found. |
知识库与 Wiki 状态错误
| code | status_code | 场景示例 | message |
|---|---|---|---|
PipelineNotExist | 400 | 直接检索的知识库不存在 | Pipeline not found: kb_xxx |
PipelineNotExist | 400 | 检索的知识库不存在或不在当前业务空间 | pipeline not exist, pipeline_id: kb_xxx, workspace: workspace_xxx |
PipelineMixed | 400 | 知识库配置不匹配 | Pipeline not correct, please check |
PipelineMixed | 400 | 混合使用公共与私有知识库 | public and private pipeline mixed |
PipelineFrozen | 400 | 知识库已冻结或正在解冻 | pipeline kb_xxx is frozen, please unfreeze or wait unfreezing finish |
PipelineConfigNotExist | 400 | 知识库配置不存在 | pipeline config not exist |
WikiNotEnabled | 400 | 绑定的知识库未全部开启 Wiki | wiki is not enabled, pipeline_id: kb_xxx |
WikiPreconditionNotMet | 400 | 知识库不存在或不属于当前账号 | wiki operation is not allowed on pipeline(kb_xxx): pipeline does not exist or does not belong to the current user |
WikiPreconditionNotMet | 400 | 知识库服务尚未就绪,请稍后重试 | wiki operation is not allowed on pipeline(kb_xxx): pipeline service is not provisioned yet, please retry later |
WikiPreconditionNotMet | 400 | 开启时知识库已被删除 | wiki operation is not allowed on pipeline(kb_xxx): pipeline does not exist or is deleted |
WikiEditionNotSupported | 400 | 开启时知识库非企业版 | wiki is only available for enterprise edition pipeline, pipeline(kb_xxx) |
WikiSceneNotSupported | 400 | 开启时知识场景不是文档问答 | wiki is only available for basic document qa pipeline, pipeline(kb_xxx) |
WikiOperationConflict | 409 | 知识库正在开启/关闭中,或有其他 Wiki 操作进行中 | another wiki operation on pipeline(kb_xxx) is in progress, please retry later |
服务端错误
WikiProvisionFailed 与 WikiCollectionDeclareFailed 的 message 末段随失败原因变化,表中为示例。
| code | status_code | 场景示例 | message |
|---|---|---|---|
WikiConfigError | 500 | Wiki 配置缺失或损坏 | wiki config error, pipeline_id: kb_xxx, reason: wiki_config is null |
WikiStatusReadFailed | 500 | 读取 Wiki 开启状态失败 | wiki status read error, pipeline_id: kb_xxx |
PipelineCacheReadError | 500 | 读取知识库缓存失败 | pipeline cache read error, cache_key:cache_key_xxx |
PipelineEmbeddingError | 500 | 知识库向量模型配置异常 | pipeline embedding config(config_xxx) error. |
PipelineRerankError | 500 | 知识库重排模型配置异常 | pipeline rerank config(config_xxx) error. |
ConfigError | 500 | 检索配置异常 | config error |
SpResultError | 500 | 检索服务未返回结果 | sp result error:(sp result is null). |
SpServiceResultError | 400 | 检索服务返回失败 | sp result error:(%s). |
WikiProvisionFailed | 500 | 开启过程服务内部错误 | wiki provision failed for pipeline(kb_xxx): wiki embedding dimension cannot be resolved, model: text-embedding-v4 |
WikiCollectionDeclareFailed | 500 | 开启过程服务内部错误 | wiki index collection declare failed for pipeline(kb_xxx): update sink_config failed, pipelineServiceId: 12345 |
SystemError | 500 | 服务内部异常 | system error |
重试策略
先根据业务 code 和 message 判断错误原因,再结合传输层 HTTP 状态码决定是否重试。
| 错误类型 | 是否重试 | 处理建议 |
|---|---|---|
| 参数错误、鉴权或权限失败 | 不自动重试 | 修正参数或凭证、确认权限后重新发起请求。 |
| 资源不存在、服务未开通或配置异常 | 不自动重试 | 核对资源、服务状态及配置;配置错误即使返回业务 status_code 为 500,也应先处理错误原因。 |
| 限流 | 可重试 | 若响应包含 Retry-After,按其指示等待;否则采用退避重试。 |
| 临时服务异常 | 可有限重试 | 建议间隔 1s、2s、4s 并增加随机抖动,最多重试 3 次;持续失败时联系支持。 |
| 超时或连接中断 | 视请求而定 | 只读请求可采用退避重试;写请求先确认是否已执行成功,避免重复创建或提交。 |
request_id,以便快速定位问题。