From aef4b12de6bd022fe156e55162d4f5971202dea3 Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Wed, 26 Jul 2023 17:51:56 +0200 Subject: [PATCH 1/2] Don't try to upload deleted files It should not happen, but if the stack try to upload a deleted file, it should detect it and skip this file instead of looping on this file with an error. --- model/sharing/upload.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/model/sharing/upload.go b/model/sharing/upload.go index 4da7292b531..1aff6dfafca 100644 --- a/model/sharing/upload.go +++ b/model/sharing/upload.go @@ -224,6 +224,11 @@ func (s *Sharing) findNextFileToUpload(inst *instance.Instance, since string) (m Warnf("missing results for bulk get %v", query) return nil, 0, since, ErrInternalServerError } + if results[0]["_deleted"] == true { + inst.Logger().WithNamespace("upload"). + Warnf("cannot upload file %v", results[0]) + return nil, 0, since, ErrInternalServerError + } return results[0], int(idx), since, nil } return nil, 0, since, nil From bf6806de8b076992a3169bf76051a959a5874c7d Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Wed, 26 Jul 2023 18:05:19 +0200 Subject: [PATCH 2/2] Update model/sharing/upload.go Co-authored-by: Erwan Guyader --- model/sharing/upload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/sharing/upload.go b/model/sharing/upload.go index 1aff6dfafca..f770077bece 100644 --- a/model/sharing/upload.go +++ b/model/sharing/upload.go @@ -226,7 +226,7 @@ func (s *Sharing) findNextFileToUpload(inst *instance.Instance, since string) (m } if results[0]["_deleted"] == true { inst.Logger().WithNamespace("upload"). - Warnf("cannot upload file %v", results[0]) + Warnf("cannot upload _deleted file %v", results[0]) return nil, 0, since, ErrInternalServerError } return results[0], int(idx), since, nil