{"record":{"id":"85068dc97649814d","repo":"iflytek/astron-agent","slug":"get-variable-error-e","errorCode":null,"errorMessage":"get variable error: {e}","messagePattern":"get variable error: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/entities/variable_pool.py","lineNumber":764,"sourceCode":"                    node_value = (\n                        ref_content.name if isinstance(ref_content, NodeRef) else \"\"\n                    )\n                    return self.get_output_variable(\n                        node_id=node_id,\n                        key_name=node_value,\n                        span=span,\n                        first_only=first_only,\n                    )\n            if mapping_key in self.output_variable_mapping:\n                # Support nested access like input.iii.yyy\n                return self.get_output_variable(\n                    node_id=node_id,\n                    key_name=key_name,\n                    span=span,\n                    first_only=first_only,\n                )\n        except Exception as e:\n            raise Exception(f\"get variable error: {e}\")\n\n    def get_variable_first(self, node_id: str, key_name: str, span: Span) -> Any:\n        \"\"\"\n        Get variable value, extracting only the first element for array object.\n\n        :param node_id: ID of the node\n        :param key_name: Name of the variable\n        :param span: Span object for tracing\n        :return: Variable value (first element for arrays object)\n        \"\"\"\n        return self.get_variable(node_id, key_name, span, first_only=True)\n\n    def add_end_node_variable(\n        self, node_id: str, key_name_list: list[str], value: NodeRunResult\n    ) -> None:\n        \"\"\"\n        Add variables for end node.\n","sourceCodeStart":746,"sourceCodeEnd":782,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/entities/variable_pool.py#L746-L782","documentation":"get_variable wraps all internal resolution failures (nested key errors, schema problems, etc.) in a single generic Exception 'get variable error: {e}'. It is a catch-all re-raise, so the original error's type and code (e.g. VARIABLE_POOL_GET_PARAMETER_ERROR) are lost — only its message survives in the text.","triggerScenarios":"Any exception raised while resolving (node_id, key_name) inside get_variable's try block — most commonly missing keys in the output schema, malformed nested paths, or schema type errors — when called via get_variable_first, async_execute, _get_actual_parameter, etc.","commonSituations":"Debugging why a node failed at runtime: the log shows only 'get variable error: ...' with a nested message; key path typos in node configs; upstream schema changes breaking downstream references.","solutions":["Read the wrapped message after 'get variable error:' to identify the root cause (usually a missing-key schema error)","Fix the referenced key path against the producing node's output schema","Refactor to re-raise the original exception (or chain with `raise ... from e`) to preserve error codes","Pre-validate the key path against the schema before calling get_variable"],"exampleFix":"// before\nexcept Exception as e:\n    raise Exception(f\"get variable error: {e}\")\n// after\nexcept CustomException:\n    raise\nexcept Exception as e:\n    raise Exception(f\"get variable error: {e}\") from e","handlingStrategy":"try-catch","validationCode":"if assemble_mapping_key(node_id, key_name) not in pool.output_variable_mapping:\n    raise KeyError(f\"{node_id} does not declare output {key_name}\")","typeGuard":"def variable_available(pool, node_id: str, key_name: str) -> bool:\n    try:\n        pool.get_variable(node_id, key_name, span, first_only=False)\n        return True\n    except Exception:\n        return False","tryCatchPattern":"try:\n    val = pool.get_variable(node_id, key_name, span)\nexcept Exception as e:\n    log.error(f\"variable fetch failed for {node_id}.{key_name}: {e}\")\n    val = default","preventionTips":["Parse the wrapped message after 'get variable error:' to find the root cause","Validate key paths against the schema before calling get_variable","Prefer get_output_variable with its coded CustomException when you need error codes"],"tags":["workflow","variable-pool","error-handling","python"],"backgroundTag":"internal-invariant-violation","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"}