{"record":{"id":"b8a2d15d2ce1bcda","repo":"influxdata/influxdb","slug":"influxql-internal-error-0","errorCode":null,"errorMessage":"InfluxQL internal error: {0}","messagePattern":"InfluxQL internal error: (.+?)","errorType":"exception","errorClass":"PlannerError","httpStatus":null,"severity":"error","filePath":"core/iox_query_influxql/src/error.rs","lineNumber":36,"sourceCode":"pub(crate) fn not_implemented<T>(feature: impl Into<String>) -> Result<T> {\n    Err(map::not_implemented(feature))\n}\n\n/// Functions that return a DataFusionError rather than a `Result<T, DataFusionError>`\n/// making them convenient to use with functions like `map_err`.\npub(crate) mod map {\n    use datafusion::common::DataFusionError;\n    use influxdb_influxql_parser::time_range::ExprError;\n    use thiserror::Error;\n\n    #[derive(Debug, Error)]\n    enum PlannerError {\n        /// An unexpected error that represents a bug in IOx.\n        ///\n        /// The message is prefixed with `InfluxQL internal error: `,\n        /// which may be used by clients to identify internal InfluxQL\n        /// errors.\n        #[error(\"InfluxQL internal error: {0}\")]\n        Internal(String),\n    }\n\n    /// An error that was the result of an invalid InfluxQL query.\n    pub(crate) fn query(s: impl Into<String>) -> DataFusionError {\n        DataFusionError::Plan(s.into())\n    }\n\n    /// An error that was the result of an invalid InfluxQL parameter.\n    pub(crate) fn params(s: impl Into<String>) -> DataFusionError {\n        DataFusionError::Plan(s.into())\n    }\n\n    /// An unexpected error whilst planning that represents a bug in IOx.\n    pub(crate) fn internal(s: impl Into<String>) -> DataFusionError {\n        DataFusionError::External(Box::new(PlannerError::Internal(s.into())))\n    }\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/iox_query_influxql/src/error.rs#L18-L54","documentation":"PlannerError::Internal wraps unexpected InfluxQL planning failures with the message 'InfluxQL internal error: {0}'. It marks bugs in IOx's InfluxQL planner rather than user mistakes; clients are told to treat this prefix as an indicator of an internal error.","triggerScenarios":"Calling InfluxQL planning APIs with query shapes the planner's invariants do not cover, or hitting unreachable code paths (bad internal state, unmatched AST variants).","commonSituations":"New/unsupported InfluxQL syntax reaching an unimplemented planner branch; version drift between the influxql parser crate and the IOx planner; bugs where show-tag-values/subqueries hit unhandled cases.","solutions":["Read the wrapped String for the concrete internal cause","File a bug with the offending InfluxQL query and full error","Try simplifying or rewriting the query to avoid the unsupported construct","Check for version mismatches between the InfluxQL parser and IOx planner crates"],"exampleFix":"// before\nlet plan = make_planner().plan(query)?; // Internal(\"unhandled SHOW TAG VALUES\")\n// after\nmatch make_planner().plan(query) {\n    Err(e @ DataFusionError::Plan(msg)) if msg.starts_with(\"InfluxQL internal error\") => {\n        // report/rewrite query; see msg for the failing construct\n    }\n    other => other?,\n}","handlingStrategy":"try-catch","validationCode":"// no cheap pre-check; ensure the query only uses supported InfluxQL constructs","typeGuard":null,"tryCatchPattern":"match planner.plan(&statement) {\n    Err(e) if e.to_string().starts_with(\"InfluxQL internal error\") => {\n        report_bug(&e); fallback_plan()\n    }\n    other => other,\n}","preventionTips":["Restrict queries to documented InfluxQL features","Log full query + error for bug reports","Pin parser/planner crate versions together"],"tags":["influxql","query-planning","internal-error"],"backgroundTag":"internal-invariant-violation","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}