{"record":{"id":"6008e927f18b6e83","repo":"iflytek/astron-agent","slug":"variable-pool-set-parameter-error-node-name-self-node-node","errorCode":"VARIABLE_POOL_SET_PARAMETER_ERROR","errorMessage":"Node name: {self.node.node_id}, error message: {err}","messagePattern":"Node name: (.+?), error message: (.+?)","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/node.py","lineNumber":460,"sourceCode":"        self, result: NodeRunResult, variable_pool: VariablePool, span_context: Span\n    ) -> None:\n        \"\"\"Add start node variables to variable pool.\n\n        :param result: Start node execution result\n        :param variable_pool: Variable pool to add variables to\n        :param span_context: Tracing span context\n        :raises CustomException: When variable addition fails\n        \"\"\"\n        res_bak = copy.deepcopy(result)\n        res_bak.outputs = res_bak.inputs\n        output_keys = list(res_bak.outputs.keys())\n\n        try:\n            await variable_pool.add_variable(\n                result.node_id, output_keys, res_bak, span=span_context\n            )\n        except Exception as err:\n            raise CustomException(\n                err_code=CodeEnum.VARIABLE_POOL_SET_PARAMETER_ERROR,\n                err_msg=f\"Node name: {self.node.node_id}, error message: {err}\",\n            ) from err\n\n    async def _add_end_node_variables(\n        self, result: NodeRunResult, variable_pool: VariablePool, span_context: Span\n    ) -> None:\n        \"\"\"Add end node variables to variable pool.\n\n        :param result: End node execution result\n        :param variable_pool: Variable pool to add variables to\n        :param span_context: Tracing span context\n        :raises CustomException: When variable addition fails\n        \"\"\"\n        res_bak = copy.deepcopy(result)\n        res_bak.outputs = {}\n        output_keys = list(res_bak.outputs.keys())\n","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/node.py#L442-L478","documentation":"Raised when writing the START node's outputs into the VariablePool fails. variable_pool.add_variable throws, and it is re-wrapped as VARIABLE_POOL_SET_PARAMETER_ERROR with the node ID and underlying message so the failure is attributed to the start node's variable registration.","triggerScenarios":"add_variable raising due to pool storage failure (Redis/DB backend unavailable), duplicate/invalid output keys from the start node config, or wrong types in res_bak for the declared output schema.","commonSituations":"Redis/cache outage in the workflow runtime; a workflow where the start node's declared output variables collide or have invalid names; serialization failure of user input values.","solutions":["Check the wrapped error message for the root cause (storage backend vs. schema)","Verify Redis/DB connectivity of the variable pool backend","Fix the start node's declared output variable names/types in the editor","Inspect res_bak values for non-serializable objects"],"exampleFix":"// before: opaque pool write failure\nawait variable_pool.add_variable(node_id, keys, raw_user_input)\n// after\nif not all(isinstance(k, str) and k for k in keys):\n    raise CustomException(CodeEnum.PARAM_VALIDATE_ERROR, err_msg=\"invalid start output keys\")\nawait variable_pool.add_variable(node_id, keys, sanitize(raw_user_input))","handlingStrategy":"try-catch","validationCode":"if not redis_client.ping():\n    raise RuntimeError(\"variable pool backend (Redis) unavailable\")\nif any(not k or not isinstance(k, str) for k in output_keys):\n    raise ValueError(\"start node output keys must be non-empty strings\")","typeGuard":"function isValidPoolWrite(nodeId, keys, value) {\n  return typeof nodeId === 'string' && keys.length > 0 &&\n         keys.every(k => typeof k === 'string' && k) &&\n         isSerializable(value);\n}","tryCatchPattern":"try {\n  await engine.run(dsl)\n} catch (CustomException e) when (e.code == VARIABLE_POOL_SET_PARAMETER_ERROR) {\n  logger.error(`pool write failed at ${e.node}: ${e.message}`);\n  checkBackendHealth();\n  throw;\n}","preventionTips":["Monitor Redis/storage health for the variable pool backend","Validate start node output variable names/types at save time","Ensure user input values are JSON-serializable before run","Test workflows with storage backends degraded to catch write paths early"],"tags":["variable-pool","workflow","storage"],"backgroundTag":"database-write-failed","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"}