{"record":{"id":"e29a3c60995d145f","repo":"influxdata/influxdb","slug":"cannot-write-to-soft-deleted-database-0-it-is-marked-for","errorCode":null,"errorMessage":"cannot write to soft-deleted database '{0}' - it is marked for deletion","messagePattern":"cannot write to soft-deleted database '(.+?)' - it is marked for deletion","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/write_buffer/mod.rs","lineNumber":113,"sourceCode":"    #[error(\"error from table buffer: {0}\")]\n    TableBufferError(#[from] table_buffer::Error),\n\n    #[error(\"error in last cache: {0}\")]\n    LastCacheError(#[from] last_cache::Error),\n\n    #[error(\"database not found {db_name:?}\")]\n    DatabaseNotFound { db_name: String },\n\n    #[error(\"table not found {table_name:?} in db {db_name:?}\")]\n    TableNotFound { db_name: String, table_name: String },\n\n    #[error(\"tried accessing database that does not exist\")]\n    DbDoesNotExist,\n\n    #[error(\"tried creating database named '{0}' that already exists\")]\n    DatabaseExists(String),\n\n    #[error(\"cannot write to soft-deleted database '{0}' - it is marked for deletion\")]\n    DatabaseDeleted(String),\n\n    #[error(\"tried accessing table that do not exist\")]\n    TableDoesNotExist,\n\n    #[error(\"table '{db_name}.{table_name}' already exists\")]\n    TableAlreadyExists {\n        db_name: Arc<str>,\n        table_name: Arc<str>,\n    },\n\n    #[error(\"tried accessing column with name ({0}) that does not exist\")]\n    ColumnDoesNotExist(String),\n\n    #[error(\n        \"updating catalog on delete of last cache failed, you will need to delete the cache \\\n        again on server restart\"\n    )]","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/write_buffer/mod.rs#L95-L131","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Choose a different, existing database name for the write","Recreate the database (undelete/create) before resuming writes","Stop or repoint the writer application that targets the deleted database","Hard-delete the database if it is truly no longer needed and remove all writers"],"exampleFix":"// before\nclient.write(\"metrics-old\", line_protocol)  // metrics-old was soft-deleted\n// after\nclient.write(\"metrics\", line_protocol)  // active database","handlingStrategy":"try-catch","validationCode":"// before writing\nif catalog.database_exists(db_name) && !catalog.is_database_deleted(db_name) {\n    // safe to write\n}","typeGuard":"fn is_database_deleted(err: &WriteBufferError) -> bool {\n    matches!(err, WriteBufferError::DatabaseDeleted(_))\n}","tryCatchPattern":"match buffer.write(db_name, lines) {\n    Err(WriteBufferError::DatabaseDeleted(name)) => {\n        eprintln!(\"db '{name}' is soft-deleted; recreate or pick another db\");\n    }\n    Err(e) => return Err(e.into()),\n    Ok(v) => v,\n}","preventionTips":["Check database existence/not-deleted status before resuming writes","Repoint writers immediately after deleting a database","Use a naming/deprovisioning checklist that includes writers"],"tags":["database","write","soft-delete","influxdb3"],"backgroundTag":"database-write-failed","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}