{"record":{"id":"c5a852a25fad9d3b","repo":"iflytek/astron-agent","slug":"23900-event-not-found","errorCode":"23900","errorMessage":"Event not found","messagePattern":"Event not found","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/api/v1/chat/debug.py","lineNumber":150,"sourceCode":"    \"\"\"\n    Resume debug chat event\n    :param request: Resume request data\n    :return: Streaming or JSON response\n    \"\"\"\n    event_id = request.event_id\n    event_type = request.event_type\n    content = request.content\n    span = Span(app_id=\"\", uid=\"\", chat_id=\"\")\n    m = Meter()\n\n    with span.start(\n        attributes={\"event_id\": event_id},\n    ) as span_context:\n\n        try:\n            event: Optional[Event] = EventRegistry().get_event(event_id=event_id)\n            if event is None:\n                raise CustomException(\n                    CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR,\n                    \"Event not found\",\n                )\n\n            m.set_label(\"flow_id\", event.flow_id)\n            m.set_label(\"app_id\", event.app_id)\n\n            span.app_id = event.app_id\n            span.uid = event.uid\n            span.chat_id = event.chat_id\n\n            await span_context.add_info_events_async(\n                {\"resume_event\": json.dumps(event.dict(), ensure_ascii=False)}\n            )\n\n            if not event.status == ChatStatus.INTERRUPT.value:\n                raise CustomException(\n                    CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR,","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/api/v1/chat/debug.py#L132-L168","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Retry the debug session from the start — the original event context is unrecoverable once evicted","Obtain a fresh event_id by re-running the debug step","Check that the resume request goes to the same instance that registered the event (sticky routing/session affinity)","Verify the service was not restarted between event creation and resume; consider a persistent/shared event registry (Redis) for multi-instance deployments"],"exampleFix":"// before\nevent: Optional[Event] = EventRegistry().get_event(event_id=event_id)\nif event is None:\n    raise CustomException(CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR, \"Event not found\")\n// after\nevent: Optional[Event] = EventRegistry().get_event(event_id=event_id)\nif event is None:\n    # fall back to shared store before failing\n    event = await shared_event_store.load(event_id)\nif event is None:\n    raise CustomException(CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR, f\"Event not found: {event_id}\")","handlingStrategy":"try-catch","validationCode":"# before resuming, confirm the event is still registered\nif EventRegistry().get_event(event_id=event_id) is None:\n    print(f\"Event {event_id} no longer registered; restart the debug session\")","typeGuard":null,"tryCatchPattern":"try:\n    await resume_debug(event_id, payload)\nexcept CustomException as e:\n    if e.code == 23900:  # EVENT_REGISTRY_NOT_FOUND_ERROR\n        start_new_debug_session()  # stale/expired event, re-run debug step\n    else:\n        raise","preventionTips":["Resume debug sessions promptly before registry eviction/restart","Use sticky routing or a shared registry (Redis) in multi-instance deployments","Never cache event_ids across service restarts","Include event_id in the error message for easier diagnosis"],"tags":["workflow","debug","registry"],"backgroundTag":"entity-not-found","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"}