influxdata/influxdb · error · Error

cannot write to soft-deleted database

Error message

cannot write to soft-deleted database '{0}' - it is marked for deletion

What it means

This error from influxdb3_write's WriteBuffer Error enum means a write was attempted against a database that has been soft-deleted. Soft-deleted databases are marked for deletion but may not yet be physically removed, so the catalog still knows them but rejects writes. The library throws it to prevent data being written to a database that is about to disappear.

Solutions

  1. Choose a different, existing database name for the write
  2. Recreate the database (undelete/create) before resuming writes
  3. Stop or repoint the writer application that targets the deleted database
  4. Hard-delete the database if it is truly no longer needed and remove all writers

Example fix

// before
client.write("metrics-old", line_protocol)  // metrics-old was soft-deleted
// after
client.write("metrics", line_protocol)  // active database
Defensive patterns

Strategy: try-catch

Validate before calling

// before writing
if catalog.database_exists(db_name) && !catalog.is_database_deleted(db_name) {
    // safe to write
}

Type guard

fn is_database_deleted(err: &WriteBufferError) -> bool {
    matches!(err, WriteBufferError::DatabaseDeleted(_))
}

Try / catch

match buffer.write(db_name, lines) {
    Err(WriteBufferError::DatabaseDeleted(name)) => {
        eprintln!("db '{name}' is soft-deleted; recreate or pick another db");
    }
    Err(e) => return Err(e.into()),
    Ok(v) => v,
}

Prevention

When it happens

Trigger: Calling the write API (e.g. line-protocol write to /write) targeting a database name on which delete_database (soft delete) was previously called; or replaying/resending buffered writes for a db deleted while the client was offline.

Common situations: A client's configuration still points at a database an operator removed; automated pipelines keep writing to a retired database; a delete was run for cleanup but writers were never repointed.

Related errors


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

Appendix: source

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

    #[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>,
    },

    #[error("tried accessing column with name ({0}) that does not exist")]
    ColumnDoesNotExist(String),

    #[error(
        "updating catalog on delete of last cache failed, you will need to delete the cache \
        again on server restart"
    )]

View on GitHub (pinned to 06200ef96b)