{"record":{"id":"92cd7f61bd942e6c","repo":"juicedata/juicefs","slug":"range-d-d-s","errorCode":null,"errorMessage":"range(%d,%d): %s","messagePattern":"range\\((.+?),(.+?)\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/sync/sync.go","lineNumber":873,"sourceCode":"\t\tdefer func() {\n\t\t\t<-concurrent\n\t\t}()\n\t}\n\n\tlimits := dst.Limits()\n\tif size <= 32<<20 || !limits.IsSupportUploadPartCopy {\n\t\treturn doUploadPart(src, dst, key, off, size, key, upload.UploadID, num, calChksum)\n\t}\n\n\ttmpkey := fmt.Sprintf(\"%s.part%d\", key, num)\n\tvar up *object.MultipartUpload\n\tvar err error\n\terr = try(3, func() error {\n\t\tup, err = dst.CreateMultipartUpload(ctx, tmpkey)\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn nil, 0, fmt.Errorf(\"range(%d,%d): %s\", off, size, err)\n\t}\n\n\tpartSize := choosePartSize(up, size)\n\tn := int((size-1)/partSize) + 1\n\tlogger.Debugf(\"Copying data of %s (range: %d,%d) as %d parts (size: %d): %s\", key, off, size, n, partSize, up.UploadID)\n\tparts := make([]*object.Part, n)\n\tvar tmpChksum uint32\n\tfirst := true\n\n\tfor i := 0; i < n; i++ {\n\t\tsz := partSize\n\t\tif i == n-1 {\n\t\t\tsz = size - int64(i)*partSize\n\t\t}\n\t\tselect {\n\t\tcase <-abort:\n\t\t\tdst.AbortUpload(ctx, tmpkey, up.UploadID)\n\t\t\treturn nil, 0, fmt.Errorf(\"aborted\")","sourceCodeStart":855,"sourceCodeEnd":891,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/sync/sync.go#L855-L891","documentation":"Wraps a failure of dst.CreateMultipartUpload(ctx, tmpkey) as 'range(%d,%d): %s' in doCopyRange, including the byte offset and size of the range being copied. Without a multipart upload handle the range copy cannot proceed and returns nil part.","triggerScenarios":"Destination rejects CreateMultipartUpload: missing s3:PutObject/multipart permissions, bucket policy or object-lock blocking uploads, invalid tmpkey characters, or endpoint/network failure.","commonSituations":"Read-only or write-restricted destination buckets; providers that don't support multipart on certain storage classes; wrong region/endpoint config; special characters in keys rejected by the backend.","solutions":["Grant multipart upload permissions (CreateMultipartUpload/UploadPart/CompleteMultipartUpload) on the destination.","Fix destination endpoint/region and bucket configuration.","Check bucket policies, retention/object-lock, or storage-class restrictions that forbid multipart uploads.","Inspect the embedded backend error for the specific API denial and act on it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// preflight: can we create multipart uploads on dst?\nprobe, err := dst.CreateMultipartUpload(ctx, \".jfs-sync-probe\")\nif err != nil {\n\treturn fmt.Errorf(\"destination denies multipart upload: %w\", err)\n}\n_ = dst.AbortUpload(ctx, \".jfs-sync-probe\", probe.UploadID)","typeGuard":null,"tryCatchPattern":"up, err := dst.CreateMultipartUpload(ctx, tmpkey)\nif err != nil {\n\tif isAuthzError(err) {\n\t\treturn fmt.Errorf(\"range(%d,%d): grant multipart permissions on dst: %w\", off, size, err)\n\t}\n\treturn fmt.Errorf(\"range(%d,%d): %w\", off, size, err)\n}","preventionTips":["Verify dst credentials include multipart permissions before long jobs","Check bucket policies/object-lock/storage-class restrictions on the target","Validate endpoint/region configuration up front","Avoid special characters in keys that some backends reject"],"tags":["multipart-upload","permission","destination"],"backgroundTag":"http-error-response","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}