{"record":{"id":"5aca1c51cfa64f33","repo":"influxdata/influxdb","slug":"failed-to-deserialize-org-bucket-precision-in-request-0","errorCode":null,"errorMessage":"failed to deserialize org/bucket/precision in request: {0}","messagePattern":"failed to deserialize org/bucket/precision in request: (.+?)","errorType":"validation","errorClass":"V2WriteParseError::DecodeFail","httpStatus":null,"severity":"error","filePath":"core/iox_http/src/write/v2.rs","lineNumber":21,"sourceCode":"//!\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}\n\nimpl TryFrom<&Request> for WriteParamsV2 {\n    type Error = V2WriteParseError;\n","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/iox_http/src/write/v2.rs#L3-L39","documentation":"V2WriteParseError::DecodeFail wraps serde deserialization failures when parsing the org/bucket/precision parameters of a v2 write request. The parameters exist but fail to deserialize; the underlying serde::de::value::Error is embedded in the message.","triggerScenarios":"Sending /api/v2/write?org=...&bucket=... with an unsupported precision value or a malformed query string that fails serde_urlencoded decoding.","commonSituations":"Precision typos (precision=nanoseconds); non-UTF8 or badly percent-encoded parameter values; automation building query strings without encoding.","solutions":["Inspect the wrapped serde error in the message to find the offending parameter.","Use accepted precision values only: ns, u (or us), ms, s.","URL-encode org and bucket values, especially those containing '/', '&' or '='.","Match on V2WriteParseError::DecodeFail(_) and return 400 with the decode details."],"exampleFix":"// before\nPOST /api/v2/write?org=myorg&bucket=mybucket&precision=nanoseconds\n// after\nPOST /api/v2/write?org=myorg&bucket=mybucket&precision=ns","handlingStrategy":"try-catch","validationCode":"const PRECISIONS: [&str; 4] = [\"ns\", \"u\", \"ms\", \"s\"];\nif let Some(p) = precision {\n    assert!(PRECISIONS.contains(&p), \"invalid precision: {p}\");\n}\nassert!(!org.is_empty() && !bucket.is_empty());","typeGuard":null,"tryCatchPattern":"match err {\n    V2WriteParseError::DecodeFail(e) => /* 400 with e.to_string() */,\n    other => /* propagate */,\n}","preventionTips":["Validate precision against the allowed enum before sending.","URL-encode org/bucket values containing special characters.","Build query strings with the url crate's query_pairs_mut instead of string concatenation."],"tags":["http","write-api","v2","deserialization","query-params"],"backgroundTag":"invalid-argument-format","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"}