feat(cli): added KOPIA_IGNORE_MALFORMED_MANIFEST_CONTENTS (#1890)

This can usually help open corrupted repository and partially restore data.
This commit is contained in:
Jarek Kowalski authored and GitHub committed 2022-04-14 14:08:58 +00:00
1 parent 6fa621941f
commit f113dd28c2
1 file changed
+8
@@ -147,6 +147,14 @@ func (m *committedManifestManager) loadCommittedContentsLocked(ctx context.Conte
}, func(ci content.Info) error {
man, err := loadManifestContent(ctx, m.b, ci.GetContentID())
if err != nil {
// this can be used to allow corrupterd repositories to still open and see the
// (incomplete) list of manifests.
if os.Getenv("KOPIA_IGNORE_MALFORMED_MANIFEST_CONTENTS") != "" {
log(ctx).Warnf("ignoring malformed manifest content %v: %v", ci.GetContentID(), err)
return nil
}
return err
}
mu.Lock()