{"record":{"id":"5601d35c5333d46a","repo":"influxdata/influxdb","slug":"cannot-query-err-query-query","errorCode":null,"errorMessage":"Cannot query: {err} (query: {query})","messagePattern":"Cannot query: (.+?) \\(query: (.+?)\\)","errorType":"error_code","errorClass":"QueryEndpointError::Fail","httpStatus":null,"severity":"error","filePath":"influxdb3_py_api/src/query.rs","lineNumber":8,"sourceCode":"use arrow_array::RecordBatch;\nuse async_trait::async_trait;\nuse std::collections::HashMap;\nuse thiserror::Error;\n\n#[derive(Debug, Error)]\npub enum QueryEndpointError {\n    #[error(\"Cannot query: {err} (query: {query})\")]\n    Fail {\n        err: Box<dyn std::error::Error + Send + Sync>,\n        query: String,\n    },\n}\n\n#[async_trait]\npub trait QueryEndpoint: std::fmt::Debug + Send + Sync + 'static {\n    async fn query(\n        &self,\n        db: &str,\n        query: &str,\n        params: &HashMap<String, String>,\n    ) -> Result<Vec<RecordBatch>, QueryEndpointError>;\n}\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_py_api/src/query.rs#L1-L24","documentation":"QueryEndpointError::Fail wraps an underlying error plus the offending query string, formatted as 'Cannot query: {err} (query: {query})'. It is the error variant of the async QueryEndpoint trait, meaning a query execution failed for an implementation-defined reason. The wrapped err and echoed query identify the exact failure.","triggerScenarios":"Calling query() on a QueryEndpoint implementation when execution fails: invalid SQL, missing table, engine error — anything the implementation wraps into Fail { err, query }.","commonSituations":"Typo'd table or field names in plugin queries; queries run before the table exists; SQL syntax unsupported by the embedded engine.","solutions":["Read the wrapped err and echoed query to locate the failing SQL and cause.","Validate the SQL against the actual schema (table/column names) before executing.","Handle the error in the endpoint consumer (retry transient failures, abort or skip on permanent SQL errors)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match endpoint.query(q).await {\n    Ok(res) => ..., \n    Err(QueryEndpointError::Fail { err, query }) => {\n        eprintln!(\"query failed: {err} (query: {query})\");\n    }\n}","preventionTips":["Validate SQL table/column names against the live schema before executing.","Log the echoed query string on failure for fast diagnosis.","Distinguish transient vs permanent query errors for retry policy."],"tags":["rust","query","sql"],"backgroundTag":"sql-query-failed","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"}