From 2ec8a07d4b20824fd1c04b2081b436cdba99c98c Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Mon, 9 Jan 2023 17:31:45 -0500 Subject: [PATCH] more tolerance in zrokdir metadata checking (#134) --- zrokdir/version.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zrokdir/version.go b/zrokdir/version.go index 0f191cfb..57f43068 100644 --- a/zrokdir/version.go +++ b/zrokdir/version.go @@ -3,6 +3,7 @@ package zrokdir import ( "encoding/json" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "os" ) @@ -19,7 +20,8 @@ func checkMetadata() error { } data, err := os.ReadFile(mf) if err != nil { - return errors.Wrapf(err, "error reading metadata file '%v'", mf) + logrus.Warnf("unable to read zrokdir metadata; ignoring non-existent: %v", err) + return nil } m := &Metadata{} if err := json.Unmarshal(data, m); err != nil {