From fc1ade90f484adc9e11d07d4c2a7a5a971475692 Mon Sep 17 00:00:00 2001 From: Rakan Al-Huneiti Date: Mon, 28 Oct 2024 14:41:05 +0300 Subject: [PATCH] Fix executed migrations failure at startup (#1382) --- .../full-node/db/sov-db/src/ledger_db/migrations.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/migrations.rs b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/migrations.rs index 9ec1aa524..61a5e9105 100644 --- a/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/migrations.rs +++ b/crates/sovereign-sdk/full-node/db/sov-db/src/ledger_db/migrations.rs @@ -57,7 +57,11 @@ impl<'a> LedgerDBMigrator<'a> { let ledger_db = LedgerDB::with_config(&RocksdbConfig::new(self.ledger_path, max_open_files))?; - let executed_migrations = ledger_db.get_executed_migrations()?; + + // Return an empty vector for executed migrations in case of an error since the iteration fails + // because of the absence of the table. + let executed_migrations = ledger_db.get_executed_migrations().unwrap_or(vec![]); + // Drop the lock file drop(ledger_db);