From b74e6fd02171fa52a5d6326ab601cd3558dc0825 Mon Sep 17 00:00:00 2001 From: mdecimus Date: Mon, 7 Oct 2024 16:24:27 +0200 Subject: [PATCH] Warn when there are errors migrating domains rather than aborting migration --- crates/directory/src/backend/internal/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/directory/src/backend/internal/mod.rs b/crates/directory/src/backend/internal/mod.rs index 4268f09c..29be134e 100644 --- a/crates/directory/src/backend/internal/mod.rs +++ b/crates/directory/src/backend/internal/mod.rs @@ -370,9 +370,12 @@ impl MigrateDirectory for Store { key: [3u8].iter().chain(domain.as_bytes()).copied().collect(), })); - self.write(batch.build()) - .await - .caused_by(trc::location!())?; + if let Err(err) = self.write(batch.build()).await { + trc::error!(err + .caused_by(trc::location!()) + .details("Failed to migrate domain, probably a principal already exists") + .ctx(trc::Key::Domain, domain)); + } } if total_domain_count > 0 || total_principal_count > 0 {