{"record":{"id":"1d2d5a7126069ed2","repo":"influxdata/influxdb","slug":"no-org-bucket-destination-provided","errorCode":null,"errorMessage":"no org/bucket destination provided","messagePattern":"no org/bucket destination provided","errorType":"validation","errorClass":"V2WriteParseError::NoQueryParams","httpStatus":null,"severity":"error","filePath":"core/iox_http/src/write/v2.rs","lineNumber":17,"sourceCode":"//! Parsing of HTTP requests that conform to the [V2 Write API], with modified\n//! behaviour for single-tenancy clusters and edge/community/pro only.\n//!\n//! [V2 Write API]:\n//!     https://docs.influxdata.com/influxdb/v2.6/api/#operation/PostWrite\n\nuse iox_http_util::Request;\nuse serde::Deserialize;\n\nuse super::Precision;\n\n/// v2 DmlErrors returned when decoding the organisation / bucket information\n/// from a HTTP request and deriving the namespace name from it.\n#[derive(Debug, thiserror::Error)]\npub enum V2WriteParseError {\n    /// The request contains no org/bucket destination information.\n    #[error(\"no org/bucket destination provided\")]\n    NoQueryParams,\n\n    /// The request contains invalid parameters.\n    #[error(\"failed to deserialize org/bucket/precision in request: {0}\")]\n    DecodeFail(#[from] serde::de::value::Error),\n}\n\n/// Query parameters for v2 write requests.\n#[derive(Debug, Deserialize)]\npub struct WriteParamsV2 {\n    #[serde(default)]\n    pub org: String,\n    #[serde(default)]\n    pub bucket: String,\n\n    #[serde(default)]\n    pub precision: Precision,\n}","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/iox_http/src/write/v2.rs#L1-L35","documentation":"V2WriteParseError::NoQueryParams is returned when a v2 write request contains no org/bucket destination information. The library needs org and bucket query parameters to derive the target namespace; without them the request is rejected.","triggerScenarios":"POSTing to /api/v2/write with no query parameters, or with only precision supplied and both org and bucket missing.","commonSituations":"InfluxDB 2.x clients misconfigured so org/bucket env vars are empty; SDK calls omitting the WriteParams; copy-pasted v1 URLs (which use db) pointed at the v2 endpoint.","solutions":["Add org and bucket query parameters to the v2 write URL.","Verify the client's org/bucket configuration values are non-empty.","If writing v1-style requests, use the v1 endpoint which accepts db instead.","Handle V2WriteParseError::NoQueryParams with a 400 response naming the missing org/bucket params."],"exampleFix":"// before\nPOST /api/v2/write?precision=ns\n// after\nPOST /api/v2/write?org=myorg&bucket=mybucket&precision=ns","handlingStrategy":"validation","validationCode":"let params: Vec<(String, String)> = url.query_pairs().into_owned().collect();\nassert!(params.iter().any(|(k, _)| k == \"org\") && params.iter().any(|(k, _)| k == \"bucket\"),\n        \"v2 write requires org and bucket params\");","typeGuard":null,"tryCatchPattern":"match err {\n    V2WriteParseError::NoQueryParams => /* 400: org and bucket query parameters required */,\n    other => /* propagate */,\n}","preventionTips":["Set org and bucket explicitly in client configuration and validate at startup.","Do not reuse v1 URLs against the v2 endpoint.","Use SDK write builders that require org/bucket."],"tags":["http","write-api","v2","query-params"],"backgroundTag":"missing-required-argument","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"}