From db02545ef32b309a01fd465422226ca8c517c4e4 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Fri, 6 Mar 2020 20:50:55 +0100 Subject: [PATCH] lib/db: Be more lenient during migration (fixes #6397) (#6398) --- lib/db/schemaupdater.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/db/schemaupdater.go b/lib/db/schemaupdater.go index 7dd454d29..70ab54ea0 100644 --- a/lib/db/schemaupdater.go +++ b/lib/db/schemaupdater.go @@ -452,7 +452,16 @@ func (db *schemaUpdater) updateSchemato9(prev int) error { metas := make(map[string]*metadataTracker) for it.Next() { intf, err := t.unmarshalTrunc(it.Value(), false) - if err != nil { + if backend.IsNotFound(err) { + // Unmarshal error due to missing parts (block list), probably + // due to a bad migration in a previous RC. Drop this key, as + // getFile would anyway return this as a "not found" in the + // normal flow of things. + if err := t.Delete(it.Key()); err != nil { + return err + } + continue + } else if err != nil { return err } fi := intf.(protocol.FileInfo)