influxdata/influxdb · error · ParseDataTypeError

is not a valid data type, values are int64, uint64…

Error message

{0} is not a valid data type, values are int64, uint64, float64, utf8, and bool

What it means

ParseDataTypeError is returned when a string cannot be parsed into the DataType enum, which only accepts int64, uint64, float64, utf8, and bool. It carries the offending input so the message names exactly what was rejected and lists the valid values.

Solutions

  1. Use one of the exact accepted values: int64, uint64, float64, utf8, bool (lowercase).
  2. Replace legacy InfluxDB type names: integer→int64, float→float64, string→utf8, boolean→bool.
  3. Check for typos and stray whitespace in the argument (quote it if needed).
  4. Use uint64 only for unsigned data; use int64 for signed integers.

Example fix

// before
influxdb3 create table ... --field temperature:float
// after
influxdb3 create table ... --field temperature:float64
Defensive patterns

Strategy: validation

Validate before calling

const VALID: [&str; 5] = ["int64", "uint64", "float64", "utf8", "bool"];
fn validate_data_type(s: &str) -> Result<(), String> {
    if !VALID.contains(&s) {
        return Err(format!("'{s}' invalid; use int64, uint64, float64, utf8, bool"));
    }
    Ok(())
}

Type guard

fn is_valid_data_type(s: &str) -> bool {
    matches!(s, "int64" | "uint64" | "float64" | "utf8" | "bool")
}

Prevention

When it happens

Trigger: Passing a --type / data-type CLI argument (e.g. when creating a table field or defining a schema) whose value is not one of the five exact strings: int64, uint64, float64, utf8, bool.

Common situations: Using InfluxQL/SQL-style or InfluxDB 1.x type names (integer, float, string, boolean, timestamp) instead of the arrow-style names; capitalization like INT64 or Float; abbreviations (int, str, bool vs utf8 confusion); forgetting to specify uint64 when data is unsigned.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/05ab5e559541b25b. Report an issue: GitHub.

Appendix: source

Thrown at influxdb3_commands/src/common.rs:95

        Ok(Self((
            key.parse().map_err(Into::into)?,
            value.parse().map_err(Into::into)?,
        )))
    }
}

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum DataType {
    Int64,
    Uint64,
    Float64,
    Utf8,
    Bool,
}

#[derive(Debug, PartialEq, Eq, thiserror::Error)]
#[error("{0} is not a valid data type, values are int64, uint64, float64, utf8, and bool")]
pub struct ParseDataTypeError(String);

impl FromStr for DataType {
    type Err = ParseDataTypeError;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s {
            "int64" => Ok(Self::Int64),
            "uint64" => Ok(Self::Uint64),
            "float64" => Ok(Self::Float64),
            "utf8" => Ok(Self::Utf8),
            "bool" => Ok(Self::Bool),
            _ => Err(ParseDataTypeError(s.into())),
        }
    }
}

impl Display for DataType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

View on GitHub (pinned to 06200ef96b)