{"record":{"id":"64d8e0752d52c593","repo":"risingwavelabs/risingwave","slug":"invalid-state-0","errorCode":null,"errorMessage":"invalid state: {0}","messagePattern":"invalid state: (.+?)","errorType":"exception","errorClass":"ExprError","httpStatus":null,"severity":"error","filePath":"src/expr/core/src/error.rs","lineNumber":119,"sourceCode":"\n    #[error(\"Context {0} not found\")]\n    Context(&'static str),\n\n    #[error(\"field name must not be null\")]\n    FieldNameNull,\n\n    #[error(\"too few arguments for format()\")]\n    TooFewArguments,\n\n    #[error(\n        \"null value in column \\\"{col_name}\\\" of relation \\\"{table_name}\\\" violates not-null constraint\"\n    )]\n    NotNullViolation {\n        col_name: Box<str>,\n        table_name: Box<str>,\n    },\n\n    #[error(\"invalid state: {0}\")]\n    InvalidState(String),\n\n    /// Function error message returned by UDF.\n    /// TODO: replace with `Function`\n    #[error(\"{0}\")]\n    Custom(String),\n\n    /// Error from a function call.\n    ///\n    /// Use [`ExprError::function`] to create this error.\n    #[error(\"error while evaluating expression `{display}`\")]\n    Function {\n        display: Box<str>,\n        #[backtrace]\n        // We don't use `anyhow::Error` because we don't want to always capture the backtrace.\n        source: Box<dyn std::error::Error + Send + Sync>,\n    },\n}","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/expr/core/src/error.rs#L101-L137","documentation":"ExprError::InvalidState is a generic catch-all variant in the expression error enum indicating the expression engine reached a state that should be impossible or unsupported. It wraps an arbitrary message string describing the specific invariant that was violated. Because it is 'invalid state', it usually signals a bug or an unhandled internal condition rather than bad user input.","triggerScenarios":"Any code path in the expr crates that calls ExprError::InvalidState(format!(...)) when an internal invariant fails — e.g. an enum variant, phase, or expression shape the code assumed could not occur.","commonSituations":"Hitting an unimplemented or logically unreachable branch while evaluating expressions; version mismatches between frontend planning and expression execution where a new expression kind is not handled downstream.","solutions":["Read the wrapped message string to identify which invariant failed","Check for version mismatch between frontend/meta/stream/batch components and upgrade all nodes consistently","Search the codebase for the message to locate the throwing site and determine whether it is a known unsupported path","File a bug with the full message and query if the state should be valid"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match err.downcast_ref::<ExprError>() { Some(ExprError::InvalidState(msg)) => log_bug_and_report(msg), _ => propagate(err) }","preventionTips":["Keep frontend and compute component versions consistent in deployments","Treat this error as a bug: capture the wrapped message and query for reports","Search the repo for the message before filing an issue"],"tags":["rust","expression-eval","internal-invariant"],"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-14T16:17:12.679Z"}