{"record":{"id":"78ac7c562a7b2634","repo":"risingwavelabs/risingwave","slug":"session-not-found","errorCode":null,"errorMessage":"Session not found","messagePattern":"Session not found","errorType":"error_code","errorClass":"ErrorCode","httpStatus":null,"severity":"warning","filePath":"src/frontend/src/error.rs","lineNumber":151,"sourceCode":"    ),\n    #[error(\"Catalog error: {0}\")]\n    CatalogError(\n        #[source]\n        #[backtrace]\n        #[message]\n        BoxedError,\n    ),\n    #[error(\"Protocol error: {0}\")]\n    ProtocolError(#[message] String),\n    #[error(\"Scheduler error: {0}\")]\n    SchedulerError(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n    #[error(\"Task not found\")]\n    TaskNotFound,\n    #[error(\"Session not found\")]\n    SessionNotFound,\n    #[error(\"Invalid reference: {0}\")]\n    InvalidReference(String),\n    #[error(\"Item not found: {0}\")]\n    ItemNotFound(String),\n    #[error(\"Duplicate Relation Name: {0}\")]\n    DuplicateRelationName(String),\n    #[error(\"Invalid insert operation: {0}\")]\n    InsertViolation(String),\n    #[error(\"Invalid input syntax: {0}\")]\n    InvalidInputSyntax(#[message] String),\n    #[error(\"Cannot compare in memory: {0}\")]\n    MemComparableError(#[from] memcomparable::Error),\n    #[error(\"Error while de/se values: {0}\")]\n    ValueEncodingError(\n        #[from]\n        #[backtrace]\n        ValueEncodingError,","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/error.rs#L133-L169","documentation":"RisingWave frontend's ErrorCode::SessionNotFound unit variant, rendered as \"Session not found\". It is returned when an operation targets a client session that the frontend no longer knows — for example KILL of a local process whose session ID is absent (src/frontend/src/handler/kill_process.rs:71).","triggerScenarios":"Running KILL <process_id> (handle_kill_local) with an ID that does not match any live session on this frontend; targeting a session after it disconnected or the frontend restarted.","commonSituations":"KILLing a query that already finished; KILL routed by a load balancer to a different frontend node than the one owning the session; stale PID captured before a frontend restart.","solutions":["List live sessions first (SHOW PROCESSLIST equivalent) and KILL only an ID that is currently present.","Ensure the KILL request reaches the same frontend node that owns the session (direct connection or sticky routing).","Retry only if the target was expected to exist; otherwise treat as benign — the session already ended.","Re-fetch the process ID right before issuing KILL to avoid acting on stale data."],"exampleFix":"// before\nKILL 42; -- guessed id\n// after\n-- from processlist output, pick a live id\nKILL <id_from_show_processlist>;","handlingStrategy":"validation","validationCode":"-- before KILL\nSELECT process_id FROM rw_processlist WHERE process_id = <pid>;","typeGuard":null,"tryCatchPattern":"try { await kill(pid) } catch (e) {\n  if (/Session not found/.test(e.message)) return 'session already gone';\n  throw e;\n}","preventionTips":["Always fetch fresh PIDs from the processlist immediately before KILL.","Connect directly to the frontend node owning the session for KILL operations.","Treat missing sessions as benign in admin scripts."],"tags":["session","risingwave","kill","processlist"],"backgroundTag":"record-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}