From db8c007983efa670c81c6b5e4ee2fc8f8e362df3 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 14 Apr 2023 16:30:35 +0100 Subject: [PATCH] swift: ignore 404 error when deleting an object See: https://forum.rclone.org/t/rclone-should-optionally-ignore-404-for-delete/37592 --- backend/swift/swift.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/swift/swift.go b/backend/swift/swift.go index 7806dd505..95163d912 100644 --- a/backend/swift/swift.go +++ b/backend/swift/swift.go @@ -1558,6 +1558,10 @@ func (o *Object) Remove(ctx context.Context) (err error) { // Remove file/manifest first err = o.fs.pacer.Call(func() (bool, error) { err = o.fs.c.ObjectDelete(ctx, container, containerPath) + if err == swift.ObjectNotFound { + fs.Errorf(o, "Dangling object - ignoring: %v", err) + err = nil + } return shouldRetry(ctx, err) }) if err != nil {