{"record":{"id":"c1d45572c0b04863","repo":"influxdata/influxdb","slug":"transparent-orgbucketmappingerror","errorCode":null,"errorMessage":"<transparent: OrgBucketMappingError>","messagePattern":"<transparent: OrgBucketMappingError>","errorType":"exception","errorClass":"MultiTenantExtractError","httpStatus":null,"severity":"error","filePath":"core/iox_http/src/write/multi_tenant.rs","lineNumber":19,"sourceCode":"//! Parsing of HTTP requests that conform to the [V2 Write API] only.\n//!\n//! [V2 Write API]:\n//!     https://docs.influxdata.com/influxdb/v2.6/api/#operation/PostWrite\n\nuse async_trait::async_trait;\nuse data_types::{NamespaceName, OrgBucketMappingError};\nuse iox_http_util::Request;\n\nuse super::{\n    WriteParams, WriteParseError, WriteRequestUnifier,\n    v2::{V2WriteParseError, WriteParamsV2},\n};\n\n/// Request parsing errors when operating in \"single tenant\" mode.\n#[derive(Debug, thiserror::Error)]\npub enum MultiTenantExtractError {\n    /// A failure to map a org & bucket to a reasonable [`NamespaceName`].\n    #[error(transparent)]\n    InvalidOrgAndBucket(#[from] OrgBucketMappingError),\n\n    /// A [`WriteParamsV2`] failed to be parsed from the HTTP request.\n    #[error(transparent)]\n    ParseV2Request(#[from] V2WriteParseError),\n}\n\n/// Implement a by-ref conversion to avoid \"moving\" the inner errors when only\n/// matching against the variants is necessary (the actual error content is\n/// discarded, replaced with only a HTTP code)\nimpl From<&MultiTenantExtractError> for hyper::StatusCode {\n    fn from(value: &MultiTenantExtractError) -> Self {\n        // Exhaustively match the inner parser errors to ensure new additions\n        // have to be explicitly mapped and are not accidentally mapped to a\n        // \"catch all\" code.\n        match value {\n            MultiTenantExtractError::InvalidOrgAndBucket(_) => Self::BAD_REQUEST,\n            MultiTenantExtractError::ParseV2Request(","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/iox_http/src/write/multi_tenant.rs#L1-L37","documentation":"This is a transparent wrapper in iox_http's MultiTenantExtractError for OrgBucketMappingError. It occurs when parsing a write request in multi-tenant mode fails because the org and bucket from the HTTP request could not be mapped to a valid NamespaceName. The display output is entirely the inner error's message.","triggerScenarios":"Handling a multi-tenant HTTP write request whose org/bucket identifiers cannot be converted into a reasonable namespace name (invalid characters, empty values).","commonSituations":"Clients sending writes to wrong or malformed org/bucket names; misconfigured SDK endpoints omitting org/bucket; URL-encoding issues.","solutions":["Read the inner OrgBucketMappingError message to see which org/bucket failed.","Verify the request's org and bucket query parameters are present and well-formed.","Check that the bucket exists and its name maps to a valid NamespaceName.","Fix the client configuration (org/bucket) issuing the write."],"exampleFix":"// before\nlet params = WriteParamsV2 { org: \"\".into(), bucket: \"bad/bucket\".into(), .. };\n// after\nlet params = WriteParamsV2 { org: \"my-org\".into(), bucket: \"my-bucket\".into(), .. };","handlingStrategy":"validation","validationCode":"// Rust: pre-validate org/bucket before issuing a multi-tenant write\nfn valid_org_bucket(org: &str, bucket: &str) -> bool {\n    !org.is_empty() && !bucket.is_empty()\n        && org.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_')\n        && bucket.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_')\n}","typeGuard":"fn is_invalid_org_bucket(e: &MultiTenantExtractError) -> bool {\n    matches!(e, MultiTenantExtractError::InvalidOrgAndBucket(_))\n}","tryCatchPattern":null,"preventionTips":["Always send non-empty, well-formed org and bucket parameters","Confirm the bucket name maps to a valid namespace on the server","URL-encode org/bucket correctly in client SDK configuration"],"tags":["http","write","namespace","multi-tenant"],"backgroundTag":"invalid-identifier-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"}