iflytek/astron-agent · error · CustomException

23900

23900

Error message

Event not found

What it means

resume_debug in the workflow chat debug API raises CustomException(EVENT_REGISTRY_NOT_FOUND_ERROR, code 23900) when EventRegistry has no event registered under the provided event_id. The debug resume flow requires the original event object (flow_id, app_id) to continue execution, and it cannot be found in the in-memory registry.

Solutions

  1. Retry the debug session from the start — the original event context is unrecoverable once evicted
  2. Obtain a fresh event_id by re-running the debug step
  3. Check that the resume request goes to the same instance that registered the event (sticky routing/session affinity)
  4. Verify the service was not restarted between event creation and resume; consider a persistent/shared event registry (Redis) for multi-instance deployments

Example fix

// before
event: Optional[Event] = EventRegistry().get_event(event_id=event_id)
if event is None:
    raise CustomException(CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR, "Event not found")
// after
event: Optional[Event] = EventRegistry().get_event(event_id=event_id)
if event is None:
    # fall back to shared store before failing
    event = await shared_event_store.load(event_id)
if event is None:
    raise CustomException(CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR, f"Event not found: {event_id}")
Defensive patterns

Strategy: try-catch

Validate before calling

# before resuming, confirm the event is still registered
if EventRegistry().get_event(event_id=event_id) is None:
    print(f"Event {event_id} no longer registered; restart the debug session")

Try / catch

try:
    await resume_debug(event_id, payload)
except CustomException as e:
    if e.code == 23900:  # EVENT_REGISTRY_NOT_FOUND_ERROR
        start_new_debug_session()  # stale/expired event, re-run debug step
    else:
        raise

Prevention

When it happens

Trigger: Client calls the debug-resume endpoint with an event_id that was never registered, or whose registration has expired/been evicted (service restart, TTL cleanup, different worker instance).

Common situations: Backend restarted between the initial debug event and the resume call (in-memory registry lost), load-balanced deployment where the resume request hits a different instance than the one holding the event, client passing a stale or mistyped event_id, event evicted after a timeout.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

Thrown at core/workflow/api/v1/chat/debug.py:150

    """
    Resume debug chat event
    :param request: Resume request data
    :return: Streaming or JSON response
    """
    event_id = request.event_id
    event_type = request.event_type
    content = request.content
    span = Span(app_id="", uid="", chat_id="")
    m = Meter()

    with span.start(
        attributes={"event_id": event_id},
    ) as span_context:

        try:
            event: Optional[Event] = EventRegistry().get_event(event_id=event_id)
            if event is None:
                raise CustomException(
                    CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR,
                    "Event not found",
                )

            m.set_label("flow_id", event.flow_id)
            m.set_label("app_id", event.app_id)

            span.app_id = event.app_id
            span.uid = event.uid
            span.chat_id = event.chat_id

            await span_context.add_info_events_async(
                {"resume_event": json.dumps(event.dict(), ensure_ascii=False)}
            )

            if not event.status == ChatStatus.INTERRUPT.value:
                raise CustomException(
                    CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR,

View on GitHub (pinned to 5e758547a8)