{"record":{"id":"e42b9970d3cd269f","repo":"influxdata/influxdb","slug":"query-error-0","errorCode":null,"errorMessage":"query error: {0}","messagePattern":"query error: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":320,"sourceCode":"    // ToStrError\n    #[error(\"to str error: {0}\")]\n    ToStr(#[from] hyper::header::ToStrError),\n\n    // SerdeJsonError\n    #[error(\"serde json error: {0}\")]\n    SerdeJson(#[from] serde_json::Error),\n\n    // Influxdb3 Write\n    #[error(\"serde json error: {0}\")]\n    Influxdb3Write(#[from] influxdb3_write::Error),\n\n    #[error(\"datafusion error: {0}\")]\n    Datafusion(#[from] DataFusionError),\n\n    #[error(\"io error: {0}\")]\n    Io(#[from] std::io::Error),\n\n    #[error(\"query error: {0}\")]\n    Query(#[from] QueryExecutorError),\n\n    #[error(transparent)]\n    DbName(#[from] ValidateDbNameError),\n\n    #[error(\"partial write of line protocol occurred\")]\n    PartialLpWrite(BufferedWriteRequest),\n\n    #[error(\"error in InfluxQL statement: {0}\")]\n    InfluxqlRewrite(#[from] rewrite::Error),\n\n    #[error(\"must provide only one InfluxQl statement per query\")]\n    InfluxqlSingleStatement,\n\n    #[error(\"must specify a 'db' parameter, or provide the database in the InfluxQL query\")]\n    InfluxqlNoDatabase,\n\n    #[error(","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L302-L338","documentation":"This variant wraps QueryExecutorError, raised by the query executor that mediates between the HTTP layer and the write/query engine. It indicates the query could not be planned or executed at the executor level — distinct from raw DataFusion failures — such as unknown databases or executor-side validation failures.","triggerScenarios":"Sending a query to /query or /api/v3/query_* where the executor rejects it: the database does not exist, the namespace cannot be resolved, or the executor fails preparing the statement.","commonSituations":"Querying a database (bucket) name that was never created or was deleted; wrong db parameter casing; querying a server in a state where the catalog has not loaded the database.","solutions":["Confirm the database name in the `db` query parameter exists on this server.","Read the inner QueryExecutorError message for the executor-level cause.","Create the database or write at least one point before querying it.","Check server logs for catalog/executor problems if the database demonstrably exists."],"exampleFix":"// before\ncurl 'http://localhost:8181/query?db=prod_db' --data-urlencode 'q=SELECT * FROM cpu'\n// after\n# verify the database exists first, then use the exact name\ncurl 'http://localhost:8181/query?db=prod-db' --data-urlencode 'q=SELECT * FROM cpu'","handlingStrategy":"validation","validationCode":"// verify the database exists before querying\nconst dbs = await fetch(`${host}/api/v3/config/databases`);\nif (!dbs.includes(db)) throw new Error(`database ${db} does not exist`);","typeGuard":null,"tryCatchPattern":"try { await execQuery(db, q); } catch (e) { if (e.message.startsWith('query error: ')) console.error('executor rejected query:', e.message); throw e; }","preventionTips":["Always pass the exact db name in the db parameter","Create/write to the database before querying it","Avoid case variations in database names","Log the resolved database with each query for debugging"],"tags":["query","executor","http-api"],"backgroundTag":"database-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"}