{"record":{"id":"c8dc77352cdc2290","repo":"FuelLabs/fuel-core","slug":"couldn-t-create-new-backup-for-path","errorCode":null,"errorMessage":"Couldn't create new backup for path `{}`: {}","messagePattern":"Couldn't create new backup for path `(.+?)`: (.+?)","errorType":"exception","errorClass":"DatabaseError::BackupError","httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/state/rocks_db.rs","lineNumber":836,"sourceCode":"        let mut backup_engine = Self::backup_engine(backup_dir)?;\n\n        let db_config = DatabaseConfig {\n            cache_capacity: None,\n            max_fds: -1,\n            columns_policy: ColumnsPolicy::Lazy,\n        };\n\n        let db = Self::open_read_only(\n            db_dir,\n            enum_iterator::all::<Description::Column>().collect::<Vec<_>>(),\n            false,\n            db_config,\n        )?;\n\n        backup_engine\n            .create_new_backup_flush(&db.db, true)\n            .map_err(|e| {\n                DatabaseError::BackupError(anyhow::anyhow!(\n                    \"Couldn't create new backup for path `{}`: {}\",\n                    backup_dir.as_ref().display(),\n                    e\n                ))\n            })?;\n\n        Ok(())\n    }\n\n    /// We delegate opening of restored db to consumer, so they can apply their own options\n    #[cfg(feature = \"backup\")]\n    pub fn restore<P: AsRef<Path> + ?Sized>(\n        db_dir: &P,\n        backup_dir: &P,\n    ) -> DatabaseResult<()> {\n        use rocksdb::backup::RestoreOptions;\n\n        let mut backup_engine = Self::backup_engine(backup_dir)?;","sourceCodeStart":818,"sourceCodeEnd":854,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/state/rocks_db.rs#L818-L854","documentation":"BackupEngine::create_new_backup_flush(&db, true) failed during DatabaseDescription::backup, wrapped as DatabaseError::BackupError. The node opens the database read-only and flushes it into a new backup; failure is an I/O-level error while writing the backup — disk full, write error on the volume, or the source db being in a bad or locked state.","triggerScenarios":"Running backup with insufficient disk space in the backup directory; IO errors on the backup volume; backing up database files that are corrupted or concurrently locked by another process.","commonSituations":"Scheduled backups on nodes whose state has grown to fill the disk; backups taken during heavy write load; filesystem or hardware problems on the backup mount.","solutions":["Free space on the backup volume (a backup is roughly the size of the database) and retry.","Make sure no other process holds RocksDB locks on the db directory and the node is not being migrated concurrently.","Check dmesg and filesystem health for IO errors; move the backup directory to a healthy volume.","If the source db is suspected corrupt, repair it or restore from an earlier backup before backing up again."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"fn enough_space_for_backup(path: &std::path::Path, db_size: u64) -> bool {\n    // compare available space (statvfs) against the db size; backups are roughly db-sized\n    nix::sys::statvfs::statvfs(path)\n        .map(|s| (s.blocks_available() as u64) * s.fragment_size() >= db_size)\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match RocksDb::<Description>::backup(db_dir, backup_dir, db_config) {\n    Err(e) if e.to_string().contains(\"Couldn't create new backup\") => {\n        // free disk space, ensure the db is not locked or corrupt, then retry\n    }\n    rest => rest,\n}","preventionTips":["Monitor free space on the backup volume and alert before it fills.","Size backup volumes for at least the current db size plus growth headroom.","Avoid running backup while migrating or compacting the db."],"tags":["rocksdb","backup","disk","io","fuel-core","rust"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}