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
- Use one of the exact accepted values: int64, uint64, float64, utf8, bool (lowercase).
- Replace legacy InfluxDB type names: integer→int64, float→float64, string→utf8, boolean→bool.
- Check for typos and stray whitespace in the argument (quote it if needed).
- 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
- Map legacy InfluxDB type names to the arrow-style names before use (float→float64, string→utf8, etc.).
- Keep a lookup table of accepted type strings in scripts.
- Enforce lowercase input; the parser is exact-match.
- Use 'bool' not 'boolean' and 'utf8' not 'string'.
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
- must be formatted as "key=value"
- Cannot parse object store config
- Could not find '_'
- Could not interpret bytes as `PartitionHashId
- Invalid database ID
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)