{"record":{"id":"830a964386df191a","repo":"influxdata/influxdb","slug":"transparent-multitenantextracterror","errorCode":null,"errorMessage":"<transparent: MultiTenantExtractError>","messagePattern":"<transparent: MultiTenantExtractError>","errorType":"exception","errorClass":"WriteParseError","httpStatus":null,"severity":"error","filePath":"core/iox_http/src/write/params.rs","lineNumber":53,"sourceCode":"\n#[derive(Debug)]\n/// Standardized DML operation parameters\npub struct WriteParams {\n    pub namespace: NamespaceName<'static>,\n    pub precision: Precision,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum WriteParseError {\n    #[error(\"not implemented\")]\n    NotImplemented,\n\n    /// An error parsing a single-tenant HTTP request.\n    #[error(transparent)]\n    SingleTenantError(#[from] SingleTenantExtractError),\n\n    /// An error parsing a multi-tenant HTTP request.\n    #[error(transparent)]\n    MultiTenantError(#[from] MultiTenantExtractError),\n}\n\nimpl From<&WriteParseError> for hyper::StatusCode {\n    fn from(value: &WriteParseError) -> Self {\n        match value {\n            WriteParseError::NotImplemented => Self::METHOD_NOT_ALLOWED,\n            WriteParseError::SingleTenantError(e) => Self::from(e),\n            WriteParseError::MultiTenantError(e) => Self::from(e),\n        }\n    }\n}\n\n/// A [`WriteRequestUnifier`] abstraction returns a unified [`WriteParams`]\n/// from [`Request`] that conform to the [V1 Write API] or [V2 Write API].\n///\n/// Differing request parsing semantics and authorization are abstracted\n/// through this trait (single tenant, vs multi tenant).","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/iox_http/src/write/params.rs#L35-L71","documentation":"This is a transparent wrapper in iox_http's WriteParseError for MultiTenantExtractError. It occurs when parsing a multi-tenant HTTP write request fails; the inner error (itself possibly wrapping OrgBucketMappingError or V2WriteParseError) is displayed unchanged. The codebase converts &WriteParseError to a hyper::StatusCode, so the content is often reduced to an HTTP code in responses.","triggerScenarios":"POSTing to the multi-tenant write endpoint where request extraction fails: unparseable WriteParamsV2 or unmappable org/bucket namespace.","commonSituations":"v2 write protocol misuse; missing or invalid org/bucket; version drift between client SDKs and the IOx HTTP API.","solutions":["Read the inner MultiTenantExtractError (and its nested cause) for the exact failure.","Validate org, bucket, precision, and body encoding against the v2 write API before sending.","Check the mapped HTTP status code returned to identify the parse stage that failed.","Upgrade/align client SDK and server API versions."],"exampleFix":"// before\nlet resp = client.post(\"/write\").body(raw).send().await?; // may 4xx with parse error\n// after\nlet params = WriteParamsV2::new(ns, Precision::Nanosecond).try_into()?; // validate first\nif let Err(e) = &params {\n    eprintln!(\"write params invalid: {e}\");\n    return Ok(status_response(e));\n}","handlingStrategy":"validation","validationCode":"// Rust: pre-flight multi-tenant write params\nfn multi_tenant_write_ok(org: &str, bucket: &str, body: &str) -> bool {\n    !org.is_empty() && !bucket.is_empty() && !body.trim().is_empty()\n        && !org.contains('/') && !bucket.contains('/')\n}","typeGuard":"fn is_multi_tenant_err(e: &WriteParseError) -> bool {\n    matches!(e, WriteParseError::MultiTenantError(_))\n}","tryCatchPattern":null,"preventionTips":["Validate org, bucket, precision, and body against the v2 API before posting","Inspect the mapped hyper::StatusCode in responses to find the failing stage","Align client SDK versions with the IOx server API version"],"tags":["http","write","parse","multi-tenant"],"backgroundTag":"schema-validation-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"}