influxdata/influxdb · error · Error

table not found in db

Error message

table not found {table_name:?} in db {db_name:?}

What it means

Indicates an operation referenced a table that does not exist in the named database. The `db_name` and `table_name` fields identify the missing table. Writes only succeed for tables that already exist (or whose creation the server is configured to allow implicitly).

Solutions

  1. List the tables in the target database and correct the measurement name
  2. Create the table explicitly (or send one write to establish it if auto-creation is enabled)
  3. Check the producer's measurement name for casing/whitespace mismatches

Example fix

// before
write_lp("sensors", "Temperture value=1", false)?; // typo in measurement
// after
let table = "Temperature";
assert!(table_exists("sensors", table)?, "create table {table} first");
write_lp("sensors", &format!("{table} value=1"), false)?;
Defensive patterns

Strategy: validation

Validate before calling

// before writing line protocol
let measurement = lp.split(',').next().unwrap().split(' ').next().unwrap();
assert!(tables(db)?.iter().any(|t| t == measurement),
        "table {measurement:?} missing in {db}; create it first");

Prevention

When it happens

Trigger: Writing line protocol whose measurement does not match any existing table in the target database; querying/deleting against a table name that was dropped or renamed; measurement name casing/whitespace mismatch.

Common situations: Renamed measurements in a producer after tables were created; line-protocol measurement with trailing whitespace or different casing; table dropped by a schema cleanup; writes sent to the wrong database.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at influxdb3_write/src/write_buffer/mod.rs:104

    #[error("error from persister: {0}")]
    PersisterError(#[from] PersisterError),

    #[error("corrupt load state: {0}")]
    CorruptLoadState(String),

    #[error("database name error: {0}")]
    DatabaseNameError(#[from] DatabaseNameError),

    #[error("error from table buffer: {0}")]
    TableBufferError(#[from] table_buffer::Error),

    #[error("error in last cache: {0}")]
    LastCacheError(#[from] last_cache::Error),

    #[error("database not found {db_name:?}")]
    DatabaseNotFound { db_name: String },

    #[error("table not found {table_name:?} in db {db_name:?}")]
    TableNotFound { db_name: String, table_name: String },

    #[error("tried accessing database that does not exist")]
    DbDoesNotExist,

    #[error("tried creating database named '{0}' that already exists")]
    DatabaseExists(String),

    #[error("cannot write to soft-deleted database '{0}' - it is marked for deletion")]
    DatabaseDeleted(String),

    #[error("tried accessing table that do not exist")]
    TableDoesNotExist,

    #[error("table '{db_name}.{table_name}' already exists")]
    TableAlreadyExists {
        db_name: Arc<str>,
        table_name: Arc<str>,

View on GitHub (pinned to 06200ef96b)