{"record":{"id":"94f36d59617e8549","repo":"risingwavelabs/risingwave","slug":"anyhow-error","errorCode":null,"errorMessage":"anyhow::Error","messagePattern":"anyhow::Error","errorType":"exception","errorClass":"SchedulerError","httpStatus":null,"severity":"error","filePath":"src/frontend/src/scheduler/error.rs","lineNumber":65,"sourceCode":"        \"Reject query: the {0} query number reaches the limit: {1}. Use `SHOW PROCESSLIST` to check for hanging queries and cancel them if needed.\"\n    )]\n    QueryReachLimit(QueryMode, u64),\n\n    #[error(transparent)]\n    BatchError(\n        #[from]\n        #[backtrace]\n        BatchError,\n    ),\n\n    #[error(transparent)]\n    Connector(\n        #[from]\n        #[backtrace]\n        ConnectorError,\n    ),\n\n    #[error(transparent)]\n    Internal(\n        #[from]\n        #[backtrace]\n        anyhow::Error,\n    ),\n}\n\nimpl From<SchedulerError> for RwError {\n    fn from(s: SchedulerError) -> Self {\n        ErrorCode::SchedulerError(Box::new(s)).into()\n    }\n}\n\nimpl From<RwError> for SchedulerError {\n    fn from(e: RwError) -> Self {\n        Self::Internal(e.into())\n    }\n}","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/scheduler/error.rs#L47-L83","documentation":"The `Internal` variant wraps any `anyhow::Error` transparently into the scheduler's `BatchError`. It is a catch-all for internal, unexpected errors that are not modeled as a dedicated variant (e.g. `anyhow!` bail sites inside the scheduler). Because it is `#[error(transparent)]`, the displayed message is whatever the inner anyhow error carried.","triggerScenarios":"Any `?` on a fallible operation inside frontend scheduler code that produces an `anyhow::Error`, e.g. `SchedulerError::Internal(anyhow!(...))` raised by plan fragmentation, split assignment, or snapshot/epoch resolution code paths in src/frontend/src/scheduler/.","commonSituations":"Running distributed queries where an invariant is broken mid-scheduling (unexpected plan shape, missing stage ids, dropped tables between plan and schedule). Often surfaces during plan fragmenter failures or snapshot query planning.","solutions":["Inspect the inner anyhow message for the concrete failure and follow the fix for that specific message.","Check the RisingWave log for the accompanying backtrace to locate the bail site.","Retry the query if the cause is a transient race (e.g. table dropped concurrently).","If reproducible, file an issue — an `Internal` error usually indicates an unexpected state the scheduler does not model."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Match on the transparent inner variant\nif let BatchError::Internal(anyhow_err) = &err {\n    log::error!(\"scheduler internal error: {anyhow_err:#}\");\n}","preventionTips":["Keep scheduler invariants covered by unit tests around stage splitting.","Check logs/backtrace for the concrete anyhow message.","Retry transient races; report reproducible ones."],"tags":["scheduler","internal","anyhow"],"backgroundTag":"internal-invariant-violation","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"}