influxdata/influxdb · error · CatalogError
Field type mismatch on table
Error message
Field type mismatch on table {table_name} column {column_name}. Existing column is {existing} but attempted to add {attempted} What it means
Thrown when a write or schema update tries to add a column (`column_name`) with a data type that differs from the type already stored for that column on the table. InfluxDB 3 columns have a fixed type once created; the error reports the existing type and the attempted type so the conflict is explicit.
Solutions
- Cast the incoming value to the existing column type in the producer (e.g. write 72.0 for a float column)
- Use a new column (or table) for the different type and migrate/backfill historical data
- Normalize producer serialization so field types are stable (explicit schema/contract)
- If the type genuinely must change, drop and recreate the table (data loss) or migrate to a new table
Example fix
// before: string where float exists temp,room=1 value="72.5" // after: match existing float column temp,room=1 value=72.5
Defensive patterns
Strategy: validation
Validate before calling
const col = schema.columns[columnName];
if (col && typeof value !== col.jsType) {
value = coerce(value, col.type); // e.g. parseFloat(value) for float columns
} Type guard
function matchesColumnType(value: unknown, existing: ColumnType): boolean {
switch (existing) {
case 'float': return typeof value === 'number';
case 'integer': return Number.isInteger(value);
case 'string': return typeof value === 'string';
case 'boolean': return typeof value === 'boolean';
}
} Try / catch
try {
await write(points);
} catch (e) {
if (/Field type mismatch/.test(String(e.message))) {
// coerce types per the reported existing type and rewrite
} throw e;
} Prevention
- Serialize numbers explicitly in producers (never stringify metrics)
- Pin field types in a schema contract and validate payloads before writing
- When changing a metric's unit/precision, write to a new column, not the same name
- Add integration tests that write representative points against a real schema
When it happens
Trigger: Writing a field whose value type differs from the column's established type — e.g. writing `temp="72"` (string) after the column was created as float; sending integer then float for the same field; producer code changes that alter serialization.
Common situations: Application upgrade changing a metric from integer to float (or vice versa); JSON payloads where values sometimes serialize as string; line protocol with a quoted number; multiple producers with inconsistent types for the same field name.
Understand the failure class
Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.
Related errors
- cannot add column because it already exists with type
- column id in series key should be valid
- column type mismatch for column
- Expected time column to have type Int64; instead found
- field does not exist
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/2b057f7d2713a3e0.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_catalog/src/error.rs:183
#[error(
"table '{table_name}' in storage mode {storage_mode:?} cannot allocate more legacy column IDs"
)]
LegacyColumnIdsExhausted {
table_name: Arc<str>,
storage_mode: StorageMode,
},
#[error("Database not found {}", db_name)]
DatabaseNotFound { db_name: Arc<str> },
#[error("Table {} not in DB schema for {}", table_name, db_name)]
TableNotFound {
db_name: Arc<str>,
table_name: Arc<str>,
},
#[error(
"Field type mismatch on table {} column {}. Existing column is {} but attempted to add {}",
table_name,
column_name,
existing,
attempted
)]
FieldTypeMismatch {
table_name: String,
column_name: String,
existing: InfluxColumnType,
attempted: InfluxColumnType,
},
#[error(
"Series key mismatch on table {}. Existing table has {}",
table_name,
existing
)]View on GitHub (pinned to 06200ef96b)