From e1c671c02833573075b2ab49b879c0bec7428969 Mon Sep 17 00:00:00 2001 From: NyaMisty Date: Mon, 3 Jun 2024 05:15:39 +0800 Subject: [PATCH] Fix volume.tier.upload nil pointer panic (#5634) --- weed/shell/command_volume_tier_upload.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/weed/shell/command_volume_tier_upload.go b/weed/shell/command_volume_tier_upload.go index c109d59d8..6932317ab 100644 --- a/weed/shell/command_volume_tier_upload.go +++ b/weed/shell/command_volume_tier_upload.go @@ -139,6 +139,12 @@ func uploadDatToRemoteTier(grpcDialOption grpc.DialOption, writer io.Writer, vol KeepLocalDatFile: keepLocalDatFile, }) + if stream == nil && copyErr == nil { + // when the volume is already uploaded, VolumeTierMoveDatToRemote will return nil stream and nil error + // so we should directly return in this case + fmt.Fprintf(writer, "volume %v already uploaded", volumeId) + return nil + } var lastProcessed int64 for { resp, recvErr := stream.Recv()