From d5c01e5ceb91c8ebd97e957376488d03c4867836 Mon Sep 17 00:00:00 2001 From: Farbod <105163300+itsfarbod@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:16:45 +0330 Subject: [PATCH] Remote gateway Bug fix (#5100) --- weed/filer/remote_mapping.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/weed/filer/remote_mapping.go b/weed/filer/remote_mapping.go index 8a7bea3d6..c8adbeb4d 100644 --- a/weed/filer/remote_mapping.go +++ b/weed/filer/remote_mapping.go @@ -15,9 +15,11 @@ func ReadMountMappings(grpcDialOption grpc.DialOption, filerAddress pb.ServerAdd oldContent, readErr = ReadInsideFiler(client, DirectoryEtcRemote, REMOTE_STORAGE_MOUNT_FILE) return readErr }); readErr != nil { - return nil, readErr + if readErr != filer_pb.ErrNotFound { + return nil, fmt.Errorf("read existing mapping: %v", readErr) + } + oldContent = nil } - mappings, readErr = UnmarshalRemoteStorageMappings(oldContent) if readErr != nil { return nil, fmt.Errorf("unmarshal mappings: %v", readErr)