diff --git a/ChangeLog.md b/ChangeLog.md index e9333143..d3cbf444 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,7 @@ # v2.4.9 BUG FIXES - fix list remote command date parsing for all `remote_storage: custom` integration examples +- clickhouse-backup should not fail when --rbac used but rbac object is not present in backup, but it should log warnings/errors, partial fix [793](https://github.com/Altinity/clickhouse-backup/issues/793) # v2.4.8 BUG FIXES diff --git a/pkg/backup/restore.go b/pkg/backup/restore.go index 95fa96ec..98302f08 100644 --- a/pkg/backup/restore.go +++ b/pkg/backup/restore.go @@ -306,7 +306,10 @@ func (b *Backuper) restoreRBAC(ctx context.Context, backupName string, disks []c if err != nil && !os.IsNotExist(err) { return err } - if err = b.restoreRBACReplicated(ctx, backupName, "access"); err != nil { + if err != nil && os.IsNotExist(err) { + return nil + } + if err = b.restoreRBACReplicated(ctx, backupName, "access"); err != nil && !os.IsNotExist(err) { return err } return nil @@ -317,6 +320,7 @@ func (b *Backuper) restoreRBACReplicated(ctx context.Context, backupName string, srcBackupDir := path.Join(b.DefaultDataPath, "backup", backupName, backupPrefixDir) info, err := os.Stat(srcBackupDir) if err != nil { + log.Warnf("stat: %s error: %v", srcBackupDir, err) return err } @@ -378,6 +382,7 @@ func (b *Backuper) restoreBackupRelatedDir(backupName, backupPrefixDir, destinat srcBackupDir := path.Join(b.DefaultDataPath, "backup", backupName, backupPrefixDir) info, err := os.Stat(srcBackupDir) if err != nil { + log.Warnf("stat: %s error: %v", srcBackupDir, err) return err }