{"record":{"id":"d16bac19cf369569","repo":"influxdata/influxdb","slug":"attempted-to-modify-resource-that-was-already-deleted-0","errorCode":null,"errorMessage":"attempted to modify resource that was already deleted: {0}","messagePattern":"attempted to modify resource that was already deleted: (.+?)","errorType":"validation","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/error.rs","lineNumber":56,"sourceCode":"\n#[derive(Debug, thiserror::Error)]\npub enum CatalogError {\n    #[error(transparent)]\n    Enterprise(#[from] EnterpriseCatalogError),\n\n    #[error(\"object store error: {0:?}\")]\n    ObjectStore(#[from] ObjectStoreCatalogError),\n\n    #[error(\"catalog format error: {0}\")]\n    Format(#[from] FormatError),\n\n    #[error(\"attempted to create a resource that already exists\")]\n    AlreadyExists,\n\n    #[error(\"the requested resource was not found: {0}\")]\n    NotFound(String),\n\n    #[error(\"attempted to modify resource that was already deleted: {0}\")]\n    AlreadyDeleted(String),\n\n    /// Request is idempotent: no catalog state would change.\n    #[error(\"no catalog changes to apply: {details}\")]\n    NoCatalogChange { details: String },\n\n    /// Request is invalid.\n    #[error(\"catalog internal error: {details}\")]\n    Internal { details: String },\n\n    #[error(\n        \"persisted catalog checkpoint sequence {checkpoint_sequence} is ahead of live catalog sequence {live_sequence}\"\n    )]\n    BackupCheckpointAhead {\n        checkpoint_sequence: u64,\n        live_sequence: u64,\n    },\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error.rs#L38-L74","documentation":"CatalogError::AlreadyDeleted(String) is thrown when an operation tries to modify a catalog resource that was already (soft-)deleted. The catalog keeps deleted resources for a retention window to allow undelete, and any mutation other than restore is rejected. The payload names the deleted resource.","triggerScenarios":"Writing to or altering a database/table after DELETE /api/v3/configure/database?db=name; updating a trigger or token that has been deleted; hard-delete window expired and a modify arrives.","commonSituations":"Applications still writing to a database another team decommissioned; scripts deleting then re-creating without waiting for the retention window; stale DDL in migrations.","solutions":["Undelete/restore the resource if within the retention window, then retry the modification","Recreate the resource and repoint the workload","Stop the stale writer (check which process/tenant still references the name)","Match on CatalogError::AlreadyDeleted and treat as a terminal condition for the workload"],"exampleFix":"// before\ncatalog.create_table(\"mydb\", \"t\", schema, Linear).await?;\n// after\nif db.table_exists(\"t\") { /* ensure not soft-deleted first */ }\n// restore deleted table via the undelete API before re-creating\n","handlingStrategy":"try-catch","validationCode":"// Rust: confirm resource is live before modifying\nlet db = catalog.db(\"mydb\")?;\nassert!(!db.deleted());","typeGuard":"fn is_already_deleted(err: &CatalogError) -> Option<&str> {\n    match err { CatalogError::AlreadyDeleted(name) => Some(name), _ => None }\n}","tryCatchPattern":"match catalog.alter_database(\"mydb\", ops).await {\n    Err(CatalogError::AlreadyDeleted(name)) => {\n        eprintln!(\"{name} is deleted; undelete or recreate before modifying\");\n    }\n    other => other?,\n}","preventionTips":["Coordinate DDL/deletes with all writers","Track soft-delete retention windows","Alert when workloads target deleted resources","Prefer recreate over modify for deleted resources"],"tags":["deleted-resource","catalog","conflict"],"backgroundTag":"invalid-state-transition","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"}