iflytek/astron-agent · error · CustomException

MEMORY_NODE_EXECUTION_ERROR

MEMORY_NODE_EXECUTION_ERROR

Error message

Memory API Exception: {raw_data.get('code')}: {raw_data.get('message')}

What it means

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).

Solutions

  1. Read the embedded code and message ('Memory API Exception: <code>: <message>') in the error to identify the server-side cause
  2. Verify the session/conversation identifiers passed to the memory node are valid and exist
  3. Check memory service health and its storage backend (Redis/DB) if the message indicates a storage failure; retry transient failures
Defensive patterns

Strategy: try-catch

Validate before calling

# Ensure referenced session/conversation IDs exist before memory operations
if not await memory_client.session_exists(session_id):
    raise ValueError(f"Memory session {session_id!r} does not exist")

Try / catch

try:
    result = await node.async_execute(variable_pool, span)
except CustomException as e:
    if e.err_code == CodeEnum.MEMORY_NODE_EXECUTION_ERROR:
        # message embeds the API code: 'Memory API Exception: <code>: <message>'
        log.error("Memory API failed: %s", e.err_msg)
        # retry for transient storage errors; fix IDs/config otherwise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/78c9c67e1c92ec89. Report an issue: GitHub.

Appendix: source

Thrown at core/workflow/engine/nodes/memory/base.py:101

        session = HttpClient.get_session()
        async with session.post(url, headers=headers, json=payload) as response:
            if response.status != 200:
                text = await response.text()
                await span.add_info_event_async(
                    f"Memory API HTTP error: {response.status}:{text}"
                )
                raise aiohttp.ClientResponseError(
                    request_info=response.request_info,
                    history=response.history,
                    status=response.status,
                    message=f"HTTP Error: {text}",
                )

            raw_data = cast(dict[str, Any], await response.json())
            await span.add_info_event_async(f"Memory API Response Data: {raw_data}")
            if raw_data.get("code") != 0:
                raise CustomException(
                    CodeEnum.MEMORY_NODE_EXECUTION_ERROR,
                    f"Memory API Exception: {raw_data.get('code')}: {raw_data.get('message')}",
                )
            return raw_data

    async def execute(
        self,
        variable_pool: VariablePool,
        span: Span,
    ) -> NodeRunResult:
        """
        Execute the memory node operation.
        :param variable_pool: Variable pool containing input variables
        :param span: Tracing span for logging
        """
        try:
            inputs, outputs = {}, {}
            for identifier in self.input_identifier:

View on GitHub (pinned to 5e758547a8)