{"record":{"id":"78c9c67e1c92ec89","repo":"iflytek/astron-agent","slug":"memory-node-execution-error","errorCode":"MEMORY_NODE_EXECUTION_ERROR","errorMessage":"Memory API Exception: {raw_data.get('code')}: {raw_data.get('message')}","messagePattern":"Memory API Exception: (.+?): (.+?)","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/memory/base.py","lineNumber":101,"sourceCode":"\n        session = HttpClient.get_session()\n        async with session.post(url, headers=headers, json=payload) as response:\n            if response.status != 200:\n                text = await response.text()\n                await span.add_info_event_async(\n                    f\"Memory API HTTP error: {response.status}:{text}\"\n                )\n                raise aiohttp.ClientResponseError(\n                    request_info=response.request_info,\n                    history=response.history,\n                    status=response.status,\n                    message=f\"HTTP Error: {text}\",\n                )\n\n            raw_data = cast(dict[str, Any], await response.json())\n            await span.add_info_event_async(f\"Memory API Response Data: {raw_data}\")\n            if raw_data.get(\"code\") != 0:\n                raise CustomException(\n                    CodeEnum.MEMORY_NODE_EXECUTION_ERROR,\n                    f\"Memory API Exception: {raw_data.get('code')}: {raw_data.get('message')}\",\n                )\n            return raw_data\n\n    async def execute(\n        self,\n        variable_pool: VariablePool,\n        span: Span,\n    ) -> NodeRunResult:\n        \"\"\"\n        Execute the memory node operation.\n        :param variable_pool: Variable pool containing input variables\n        :param span: Tracing span for logging\n        \"\"\"\n        try:\n            inputs, outputs = {}, {}\n            for identifier in self.input_identifier:","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/memory/base.py#L83-L119","documentation":"The memory node base client calls the Memory API and, even on HTTP success, inspects the JSON envelope: if raw_data['code'] != 0 it raises CustomException MEMORY_NODE_EXECUTION_ERROR embedding the API's code and message. It signals a business-level failure from the memory service (e.g. failed to read/write conversation history).","triggerScenarios":"A request to the Memory API (save/load conversation memory) returns a 200 response whose JSON body has code != 0 with a 'message' describing the failure — e.g. invalid session ID, storage backend error, or memory service internal error.","commonSituations":"Session/conversation ID referenced by the workflow doesn't exist in the memory service; Redis/DB backend of the memory service is unhealthy; memory service version mismatch producing unrecognized requests.","solutions":["Read the embedded code and message ('Memory API Exception: <code>: <message>') in the error to identify the server-side cause","Verify the session/conversation identifiers passed to the memory node are valid and exist","Check memory service health and its storage backend (Redis/DB) if the message indicates a storage failure; retry transient failures"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# Ensure referenced session/conversation IDs exist before memory operations\nif not await memory_client.session_exists(session_id):\n    raise ValueError(f\"Memory session {session_id!r} does not exist\")","typeGuard":null,"tryCatchPattern":"try:\n    result = await node.async_execute(variable_pool, span)\nexcept CustomException as e:\n    if e.err_code == CodeEnum.MEMORY_NODE_EXECUTION_ERROR:\n        # message embeds the API code: 'Memory API Exception: <code>: <message>'\n        log.error(\"Memory API failed: %s\", e.err_msg)\n        # retry for transient storage errors; fix IDs/config otherwise","preventionTips":["Validate session/conversation IDs before invoking memory nodes","Monitor memory service and its storage backend (Redis/DB) health","Add bounded retries for transient memory service errors"],"tags":["python","api","memory","workflow"],"backgroundTag":"api-error-response","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}