{"record":{"id":"606542bf3c331652","repo":"iflytek/astron-agent","slug":"knowledge-param-error","errorCode":"KNOWLEDGE_PARAM_ERROR","errorMessage":"docIds is empty","messagePattern":"docIds is empty","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/knowledge_pro/knowledge_pro_node.py","lineNumber":95,"sourceCode":"    def run_f(self) -> WorkflowNodeExecutionStatus:\n        \"\"\"\n        Get the failure execution status.\n\n        :return: FAILED status for failed execution\n        \"\"\"\n        return WorkflowNodeExecutionStatus.FAILED\n\n    async def _check_cbg_rag_param(self) -> None:\n        \"\"\"\n        Validate CBG RAG parameters.\n\n        Ensures that docIds is not empty when using CBG_RAG repository type,\n        as document IDs are required for CBG RAG operations.\n\n        :raises CustomException: If docIds is empty for CBG_RAG repository type\n        \"\"\"\n        if self.repoType == RepoTypeEnum.CBG_RAG.value and self.docIds == []:\n            raise CustomException(\n                err_code=CodeEnum.KNOWLEDGE_PARAM_ERROR, err_msg=\"docIds is empty\"\n            )\n\n    async def execute(\n        self, variable_pool: VariablePool, span: Span, **kwargs: Any\n    ) -> NodeRunResult:\n        \"\"\"\n        Execute the Knowledge Pro node operation.\n\n        Performs RAG operations by querying knowledge repositories and generating\n        responses using the configured LLM provider. Supports streaming responses\n        and handles various error conditions.\n\n        :param variable_pool: Pool of variables for the workflow execution\n        :param span: Tracing span for observability\n        :param kwargs: Additional keyword arguments including msg_or_end_node_deps\n        :return: NodeRunResult containing execution status and outputs\n        \"\"\"","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/knowledge_pro/knowledge_pro_node.py#L77-L113","documentation":"The knowledge-pro node requires a non-empty docIds list when repoType is CBG_RAG, because CBG RAG operates over an explicit set of documents. _check_cbg_rag_param raises a CustomException with KNOWLEDGE_PARAM_ERROR if docIds is an empty list for that repo type.","triggerScenarios":"Configuring a knowledge-pro node with repoType == 'cbg_rag' (RepoTypeEnum.CBG_RAG.value) while the docIds field is [] and calling execute.","commonSituations":"User picked the CBG RAG repository type in the workflow editor but never selected any documents; document IDs were bound to an upstream variable that resolved to empty; a template/JSON import omitted docIds.","solutions":["Provide at least one document ID in the node's docIds field","If repoType shouldn't be CBG_RAG, switch repoType to a type that doesn't require docIds (e.g. a knowledge-base-scoped type)","Verify the upstream variable feeding docIds actually resolves to a non-empty list at runtime"],"exampleFix":"// before\n{\"repoType\": \"cbg_rag\", \"docIds\": []}\n// after\n{\"repoType\": \"cbg_rag\", \"docIds\": [\"doc-123\", \"doc-456\"]}","handlingStrategy":"validation","validationCode":"if node_config[\"repoType\"] == \"cbg_rag\" and not node_config.get(\"docIds\"):\n    raise ValueError(\"docIds is required when repoType is cbg_rag\")","typeGuard":null,"tryCatchPattern":"try:\n    result = await node.async_execute(variable_pool, span)\nexcept CustomException as e:\n    if e.err_code == CodeEnum.KNOWLEDGE_PARAM_ERROR:\n        # surface a user-facing config fix in the editor\n        ...","preventionTips":["Make docIds required in the node form UI when CBG_RAG is selected","Check that docIds come from a non-empty upstream variable before running","Add workflow pre-run validation for repo/doc configuration"],"tags":["python","validation","workflow","knowledge"],"backgroundTag":"empty-required-field","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}