influxdata/influxdb · error · Error
specified value column
Error message
specified value column ({column_id}) does not exist in the table schema What it means
This is the `ValueColumnDoesNotExist` variant of the last-cache `Error` enum. It is raised when a column listed as a value column, referenced by ColumnId, does not exist in the table's schema. Value columns are the fields whose latest values the cache stores, so each id is validated against the table definition before the cache is built.
Solutions
- Look up fresh ColumnIds from the current table schema by column name before configuring value columns
- Correct or remove the invalid id from the `value_columns` list
- Re-derive cache configuration after any schema migration
Example fix
// before
let vals = vec![42]; // id not in current schema
create_last_cache(db, tbl, name, Some(keys), Some(vals), count, ttl);
// after
let vals = vec![schema.column_id_by_name("humidity").expect("humidity column exists")];
create_last_cache(db, tbl, name, Some(keys), Some(vals), count, ttl); Defensive patterns
Strategy: validation
Validate before calling
fn validate_value_columns(schema: &Schema, ids: &[ColumnId]) -> Result<(), String> {
ids.iter().find(|id| schema.field_id(**id).is_none())
.map_or(Ok(()), |id| Err(format!("value column id {id} not in schema")))
} Type guard
fn value_column_exists(schema: &Schema, col_id: ColumnId) -> bool {
schema.field_id(col_id).is_some()
} Try / catch
match res {
Err(LastCacheError::ValueColumnDoesNotExist { column_id }) => {
eprintln!("value column id {column_id} missing; refresh ids from schema");
}
Err(e) => return Err(e.into()),
Ok(_) => {}
} Prevention
- Derive value column ids from the live schema at cache creation time
- Name value columns in config and map to ids against the current table definition
- Regenerate cache configs after dropping/recreating tables or migrating schemas
When it happens
Trigger: Calling `create_last_cache` / `create_from_table` with `value_columns` containing a ColumnId not present in the table schema; carrying over value column ids from a dropped and recreated table.
Common situations: Stale cached schema metadata after ALTER TABLE; hard-coded value column ids that differ between environments; generating cache configs from an outdated table definition snapshot.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- column id in series key should be valid
- only uint64, int64, bool, tag, and string columns are…
- specified column (id: ) does not exist in the table…
- specified key column
- specified key column
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/c7f12b682fef7fbb.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_cache/src/last_cache/mod.rs:32
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("invalid cache size")]
InvalidCacheSize,
#[error(
"last cache already exists for database and table, but it was configured differently: {reason}"
)]
CacheAlreadyExists { reason: String },
#[error("specified column (name: {column_name}) does not exist in the table definition")]
ColumnDoesNotExistByName { column_name: String },
#[error("specified column (id: {column_id}) does not exist in the table definition")]
ColumnDoesNotExistById { column_id: ColumnId },
#[error("specified key column (id: {column_id}) does not exist in the table schema")]
KeyColumnDoesNotExist { column_id: ColumnId },
#[error("specified key column (name: {column_name}) does not exist in the table schema")]
KeyColumnDoesNotExistByName { column_name: String },
#[error("key column must be string, int, uint, or bool types, got: {column_type}")]
InvalidKeyColumn { column_type: InfluxColumnType },
#[error("specified value column ({column_id}) does not exist in the table schema")]
ValueColumnDoesNotExist { column_id: ColumnId },
#[error("requested last cache does not exist")]
CacheDoesNotExist,
}
impl Error {
fn cache_already_exists(reason: impl Into<String>) -> Self {
Self::CacheAlreadyExists {
reason: reason.into(),
}
}
}
#[cfg(test)]
mod tests;
View on GitHub (pinned to 06200ef96b)