{"record":{"id":"b87b638287a248be","repo":"influxdata/influxdb","slug":"v1-query-api-error-0","errorCode":null,"errorMessage":"v1 query API error: {0}","messagePattern":"v1 query API error: (.+?)","errorType":"http","errorClass":"Error::V1Query","httpStatus":null,"severity":"error","filePath":"core/iox_v1_query_api/src/error.rs","lineNumber":86,"sourceCode":"\n    #[error(\n        \"provided a retention policy in both the parameters ({param_rp}) and \\\n        query string ({query_rp}) that do not match, if providing a query \\\n        that specifies the retention_policy, you can omit the 'rp' parameter \\\n        from your request\"\n    )]\n    InfluxqlRetentionPolicyMismatch { param_rp: String, query_rp: String },\n\n    #[error(\"error reading field from body: {name} -- {error}\")]\n    FieldRead { name: &'static str, error: String },\n\n    #[error(\"Cannot retrieve database: {0}\")]\n    Database(DataFusionError),\n\n    #[error(\"Database {0} not found\")]\n    DatabaseNotFound(String),\n\n    #[error(\"v1 query API error: {0}\")]\n    V1Query(#[from] QueryError),\n}\n\n#[derive(Debug, Clone)]\npub enum HttpError {\n    NotFound(String),\n    Unauthorized(String),\n    Invalid(String),\n    InternalError(String),\n}\n\nimpl From<Error> for HttpError {\n    fn from(e: Error) -> Self {\n        use Error::*;\n        use HttpError::*;\n        match e {\n            NoHandler(_) => NotFound(e.to_string()),\n            InvalidMimeType(_)","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/iox_v1_query_api/src/error.rs#L68-L104","documentation":"This variant wraps a `QueryError` from the core query layer (`#[from] QueryError`) into the v1 query API's error type. It represents any error propagating up from the shared query engine — planning, execution, or permission failures — that is not one of the more specific variants above. The original error text is embedded via `{0}`.","triggerScenarios":"Any v1 /query request whose execution path fails inside the shared query subsystem (QueryError) rather than in URL decoding, rewriting, or the single-statement/db checks — e.g. execution-time failures after the statement was accepted.","commonSituations":"Errors surfacing from the ioxx query engine during execution: invalid aggregation over schema, permission-related query failures, or internal query-layer failures after rewriting succeeded.","solutions":["Read the wrapped QueryError ({0}) for the underlying cause.","Trace the wrapped error to its specific query-layer source and apply the fix for that error type.","Simplify the query to determine whether planning or execution is failing.","Upgrade or patch if the wrapped error matches a known engine bug."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isV1QueryError(e) {\n  return e instanceof Error && e.message.startsWith('v1 query API error:');\n}","tryCatchPattern":"try {\n  await queryV1({ db, q });\n} catch (e) {\n  if (/v1 query API error:/.test(e.message)) {\n    const cause = e.message.slice('v1 query API error: '.length);\n    handleUpstreamQueryError(cause); // inspect, log, or rethrow a typed error\n  } else {\n    throw e;\n  }\n}","preventionTips":["Treat this as a wrapper: always surface the inner error text for diagnosis.","Map known inner QueryError strings to typed handlers in client SDKs.","Keep client and server query-engine versions compatible."],"tags":["query","influxql","wrapped-error","internal"],"backgroundTag":"api-error-response","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"}