From 3c1494787848b38e0aff9608869007ab0f9b501d Mon Sep 17 00:00:00 2001 From: yxrxy <1532529704@qq.com> Date: Tue, 30 Dec 2025 22:41:10 +0800 Subject: [PATCH] fix(iam): preserve decrypt-failed credentials instead of deleting them (#1312) Signed-off-by: loverustfs Co-authored-by: loverustfs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: loverustfs --- crates/iam/src/store/object.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/iam/src/store/object.rs b/crates/iam/src/store/object.rs index af53aa696..1e5fb591d 100644 --- a/crates/iam/src/store/object.rs +++ b/crates/iam/src/store/object.rs @@ -410,9 +410,8 @@ impl Store for ObjectStore { data = match Self::decrypt_data(&data) { Ok(v) => v, Err(err) => { - warn!("delete the config file when decrypt failed failed: {}, path: {}", err, path.as_ref()); - // delete the config file when decrypt failed - let _ = self.delete_iam_config(path.as_ref()).await; + warn!("config decrypt failed, keeping file: {}, path: {}", err, path.as_ref()); + // keep the config file when decrypt failed - do not delete return Err(Error::ConfigNotFound); } };