{"record":{"id":"f948b08a96a462ce","repo":"influxdata/influxdb","slug":"invalid-tag-name-value-in-partition-template-0","errorCode":null,"errorMessage":"invalid tag name value in partition template: {0}","messagePattern":"invalid tag name value in partition template: (.+?)","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"core/data_types/src/partition_template.rs","lineNumber":229,"sourceCode":"    TooManyParts {\n        /// The number of template parts that were present in the user-provided custom partition\n        /// template.\n        specified: usize,\n    },\n\n    /// The partition template defines a [`TimeFormat`] part, but the\n    /// provided strftime formatter is invalid.\n    ///\n    /// [`TimeFormat`]: [`proto::template_part::Part::TimeFormat`]\n    #[error(\"invalid strftime format in partition template: {0}\")]\n    InvalidStrftime(String),\n\n    /// The partition template defines a [`TagValue`] part or [`Bucket`] part,\n    /// but the provided tag name value is invalid.\n    ///\n    /// [`TagValue`]: [`proto::template_part::Part::TagValue`]\n    /// [`Bucket`]: [`proto::template_part::Part::Bucket`]\n    #[error(\"invalid tag name value in partition template: {0}\")]\n    InvalidTagValue(String),\n\n    /// The partition template defines a [`Bucket`] part, but the provided\n    /// number of buckets is invalid.\n    ///\n    /// [`Bucket`]: [`proto::template_part::Part::Bucket`]\n    #[error(\n        \"number of buckets in partition template must be in range \\\n        [{ALLOWED_BUCKET_QUANTITIES:?}), number specified: {0}\"\n    )]\n    InvalidNumberOfBuckets(u32),\n\n    /// The partition template defines a [`TagValue`] or [`Bucket`] part\n    /// which repeats a tag name used in another [`TagValue`] or [`Bucket`] part.\n    /// This is not allowed\n    ///\n    /// [`TagValue`]: [`proto::template_part::Part::TagValue`]\n    /// [`Bucket`]: [`proto::template_part::Part::Bucket`]","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/data_types/src/partition_template.rs#L211-L247","documentation":"This error is returned when a partition template defines a `TagValue` or `Bucket` part whose tag name is invalid. Tag names must satisfy identifier rules (e.g., non-empty, valid characters, collision-free within the template), and the library rejects the template at validation time. The invalid tag name is carried in the `String` payload.","triggerScenarios":"Calling `PartitionTemplateBuilder::add_tag_part(name)` or `add_bucket_part(name, ...)` (or validating a proto template whose part is `TagValue`/`Bucket`) with a name failing tag-name validation — empty string, illegal characters, whitespace, or control characters.","commonSituations":"Config-driven template generation passing empty or placeholder names; column names containing spaces/special characters from other systems; user DDL input with typos or quoting mistakes; names truncated or mangled by upstream parsing.","solutions":["Correct the tag name in the error payload to a valid identifier (non-empty, allowed characters only, e.g. letters/digits/underscores)","Ensure the name matches an existing column/tag in the schema you intend to partition on","Sanitize or validate user-supplied tag names before constructing the template","If migrating templates from another system, rename parts that use characters this library disallows"],"exampleFix":"// before\nbuilder.add_tag_part(\"\"); // invalid: empty tag name\n// after\nbuilder.add_tag_part(\"region\");","handlingStrategy":"validation","validationCode":"fn is_valid_tag_name(name: &str) -> bool {\n    !name.is_empty()\n        && name.chars().all(|c| c.is_ascii_alphanumeric() || c == '_')\n}\nif !is_valid_tag_name(&tag) { return Err(format!(\"invalid tag name: {:?}\", tag)); }","typeGuard":"fn valid_tag_part(name: &str) -> Option<&str> {\n    is_valid_tag_name(name).then_some(name)\n}","tryCatchPattern":"let template = builder.build().map_err(|e| match e {\n    ValidationError::InvalidTagValue(name) => anyhow!(\"tag name {:?} is invalid: use non-empty identifier-safe characters\", name),\n    other => anyhow!(other),\n})?;","preventionTips":["Sanitize user/config-provided tag names (trim, strip illegal characters) before adding parts","Match tag names against the table schema so they reference real columns","Reject empty or whitespace-only names at the API boundary","When importing templates from other systems, normalize names to the library's identifier rules"],"tags":["rust","partition-template","tag-name","validation"],"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"}