diff --git a/worker/backup_handler.go b/worker/backup_handler.go index 0f4b59cd8e0..4a5993e5cd4 100644 --- a/worker/backup_handler.go +++ b/worker/backup_handler.go @@ -751,6 +751,8 @@ func (h *s3Handler) CreateFile(path string) (io.WriteCloser, error) { } func (h *s3Handler) Rename(srcPath, dstPath string) error { + srcPath = h.getObjectPath(srcPath) + dstPath = h.getObjectPath(dstPath) src := minio.NewSourceInfo(h.bucketName, srcPath, nil) dst, err := minio.NewDestinationInfo(h.bucketName, dstPath, nil, nil) if err != nil { @@ -759,7 +761,7 @@ func (h *s3Handler) Rename(srcPath, dstPath string) error { // We try copying 100 times, if it still fails, then the user should manually rename. err = x.RetryUntilSuccess(100, time.Second, func() error { if err := h.mc.CopyObject(dst, src); err != nil { - return errors.Wrapf(err, "While renaming object in s3, copy failed ") + return errors.Wrapf(err, "While renaming object in s3, copy failed") } return nil })