{"record":{"id":"e0d68693da2d8815","repo":"influxdata/influxdb","slug":"unsupported-specifier-found-in-time-format-0-supported","errorCode":null,"errorMessage":"unsupported specifier found in time format \"{0}\" - supported specifiers: {1}","messagePattern":"unsupported specifier found in time format \"(.+?)\" - supported specifiers: (.+?)","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"core/data_types/src/partition_template.rs","lineNumber":262,"sourceCode":"    /// This is not allowed\n    ///\n    /// [`TagValue`]: [`proto::template_part::Part::TagValue`]\n    /// [`Bucket`]: [`proto::template_part::Part::Bucket`]\n    #[error(\"tag name value cannot be repeated in partition template: {0}\")]\n    RepeatedTagValue(String),\n\n    /// An attempt to make a new partition template without a [`TimeFormat`]\n    /// part has been made. This is not allowed.\n    ///\n    /// [`TimeFormat`]: [`proto::template_part::Part::TimeFormat`]\n    #[error(\"partition template must include a time format part\")]\n    TimeFormatPartRequired,\n\n    /// The partition template defines a [`TimeFormat`] part, but the\n    /// provided strftime formatter contains unsupported specifiers.\n    ///\n    /// [`TimeFormat`]: [`proto::template_part::Part::TimeFormat`]\n    #[error(\"unsupported specifier found in time format \\\"{0}\\\" - supported specifiers: {1}\")]\n    UnsupportedStrfTimeSpecifier(String, String),\n\n    /// The partition template defines a [`TimeFormat`] part, but the\n    /// provided strftime format that is missing required specifiers.\n    ///\n    /// For example: using %m without %Y.\n    ///\n    /// [`TimeFormat`]: [`proto::template_part::Part::TimeFormat`]\n    #[error(\"missing required specifier(s) in time format of partition template: {0}\")]\n    MissingRequiredStrfTimeSpecifier(String),\n}\n\n/// The maximum number of template parts a custom partition template may specify, to limit the\n/// amount of space in the catalog used by the custom partition template and the partition keys\n/// created with it.\npub const MAXIMUM_NUMBER_OF_TEMPLATE_PARTS: usize = 8;\n\n/// The sentinel character used to delimit partition key parts in the partition","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/data_types/src/partition_template.rs#L244-L280","documentation":"Thrown by `UnsupportedStrfTimeSpecifier` when the TimeFormat part of a partition template contains strftime specifiers the partitioning engine does not support. Only a limited set of specifiers (such as %Y, %m, %d, %H, %M) can be used, because each supported specifier must map to a physical partition key column.","triggerScenarios":"Creating a template with `Part::TimeFormat(\"%Y week %U\")` or other exotic specifiers (%j, %U, %Z, timezones, etc.) via `PartitionTemplate::new` or the create-database API.","commonSituations":"Copying a strftime format from another system (cron, Python logging) that supports more specifiers; trying to embed literal % signs incorrectly; attempting timezone-aware formats.","solutions":["Replace unsupported specifiers with supported ones only (%Y, %m, %d, %H and similar date/time components listed in the module docs).","Move decorative text out of the format string or into the tag-based parts of the template.","Before constructing the template, check the format against the supported-specifier list and reject invalid ones client-side."],"exampleFix":"// before\nPart::TimeFormat(\"%Y week %U\".into())\n// after\nPart::TimeFormat(\"%Y-%m\".into())","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[&str] = &[\"%Y\", \"%m\", \"%d\", \"%H\", \"%M\"];\nfn specifiers(fmt: &str) -> Vec<&str> {\n    fmt.match_indices('%').filter_map(|(i, _)| fmt.get(i..i+2)).collect()\n}\nfn only_supported(fmt: &str) -> bool {\n    specifiers(fmt).iter().all(|s| SUPPORTED.contains(s))\n}","typeGuard":null,"tryCatchPattern":"match PartitionTemplate::new(parts) {\n    Err(e) if e.to_string().contains(\"unsupported specifier\") => {\n        eprintln!(\"use only supported strftime specifiers, e.g. %Y-%m-%d %H\");\n        Err(e.into())\n    }\n    other => other.map_err(Into::into),\n}","preventionTips":["Restrict format strings to the documented supported specifier set.","Do not embed literal text, timezones, or week/year-day specifiers in the format.","Test format strings against the validator before shipping them in config."],"tags":["rust","partitioning","strftime","date-format"],"backgroundTag":"invalid-date-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"}