{"record":{"id":"c80c727cb76671a6","repo":"influxdata/influxdb","slug":"missing-org-bucket-value","errorCode":null,"errorMessage":"missing org/bucket value","messagePattern":"missing org/bucket value","errorType":"validation","errorClass":"OrgBucketMappingError","httpStatus":null,"severity":"error","filePath":"core/data_types/src/namespace_name.rs","lineNumber":27,"sourceCode":"\n/// Allowlist of chars for a [`NamespaceName`] name.\n///\n/// '/' | '_' | '-' are utilized by the platforms.\nfn is_allowed(c: char) -> bool {\n    c.is_alphanumeric() || matches!(c, '/' | '_' | '-')\n}\n\n/// Errors returned when attempting to construct a [`NamespaceName`] from an org\n/// & bucket string pair.\n#[derive(Debug, Error)]\npub enum OrgBucketMappingError {\n    /// An error returned when the org, or bucket string contains invalid\n    /// characters.\n    #[error(\"invalid namespace name: {0}\")]\n    InvalidNamespaceName(#[from] NamespaceNameError),\n\n    /// Either the org, or bucket is an empty string.\n    #[error(\"missing org/bucket value\")]\n    NoOrgBucketSpecified,\n}\n\n/// [`NamespaceName`] name validation errors.\n#[derive(Debug, Error)]\npub enum NamespaceNameError {\n    /// The provided namespace name does not fall within the valid length of a\n    /// namespace.\n    #[error(\n        \"namespace name {} length must be between {} and {} characters\",\n        name,\n        LENGTH_CONSTRAINT.start(),\n        LENGTH_CONSTRAINT.end()\n    )]\n    LengthConstraint {\n        /// The user-provided namespace that failed validation.\n        name: String,\n    },","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/data_types/src/namespace_name.rs#L9-L45","documentation":"OrgBucketMappingError::NoOrgBucketSpecified is returned when either the org or the bucket string is empty while attempting to construct a NamespaceName from the pair. A namespace needs both a non-empty org and bucket component, so the library rejects the empty value up front.","triggerScenarios":"Calling the org/bucket to NamespaceName conversion with an empty string for either component, e.g. NamespaceName::from_org_bucket(\"\", \"bucket\") or (\"org\", \"\").","commonSituations":"Misconfigured InfluxDB v1 compatibility writes where the 'db' or 'u'/'p' query parameters are missing, or env-driven configuration where ORG/BUCKET variables resolve to empty strings.","solutions":["Check your client/write URL and ensure both org and bucket (or 'db' param) are supplied and non-empty.","Verify environment variables or config files feeding org/bucket are actually set.","Add an empty-string check on org and bucket before invoking the conversion.","If empty values are expected, use the direct NamespaceName constructor with a single valid name instead of the org/bucket mapping."],"exampleFix":"// before\nlet ns = NamespaceName::from_org_bucket(&org, &bucket)?; // org may be \"\"\n// after\nassert!(!org.is_empty() && !bucket.is_empty(), \"org and bucket required\");\nlet ns = NamespaceName::from_org_bucket(&org, &bucket)?;","handlingStrategy":"validation","validationCode":"if org.is_empty() || bucket.is_empty() {\n    return Err(\"both org and bucket must be non-empty\".into());\n}","typeGuard":null,"tryCatchPattern":"match NamespaceName::from_org_bucket(org, bucket) {\n    Ok(ns) => use(ns),\n    Err(OrgBucketMappingError::NoOrgBucketSpecified) => {\n        log::error!(\"org or bucket was empty; check ORG/BUCKET config\");\n        Err(ConfigError::MissingOrgBucket)\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Fail fast at startup if ORG/BUCKET env vars or config fields are empty.","Trim whitespace and re-check emptiness after trimming.","Require explicit org/bucket values in client constructors instead of defaulting to empty strings."],"tags":["rust","validation","empty-value","influxdb"],"backgroundTag":"empty-required-field","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"}