juicedata/juicefs · error

multipart upload error: %s

Error message

multipart upload error: %s

What it means

objbench uploads 3 parts concurrently via errgroup; any UploadPart error is rewritten to 'multipart upload error: %s' and returned after eg.Wait(). It means one or more part uploads failed; the original backend error is embedded.

Source

Thrown at cmd/objbench.go:1052

			}
			total := 3
			seed := make([]byte, upload.MinPartSize)
			utils.RandRead(seed)
			parts := make([]*object.Part, total)
			content := make([][]byte, total)
			for i := 0; i < total; i++ {
				content[i] = make([]byte, upload.MinPartSize)
				getMockData(seed, i, &content[i])
			}
			var eg errgroup.Group
			eg.SetLimit(4)
			for i := 1; i <= total; i++ {
				num := i
				eg.Go(func() error {
					var err error
					parts[num-1], err = blob.UploadPart(ctx, key, upload.UploadID, num, content[num-1])
					if err != nil {
						err = fmt.Errorf("multipart upload error: %s", err)
					}
					return err
				})
			}
			err = eg.Wait()
			if err != nil {
				return err
			}
			// overwrite the first part
			firstPartContent := append(seed, seed...)
			if parts[0], err = blob.UploadPart(ctx, key, upload.UploadID, 1, firstPartContent); err != nil {
				return fmt.Errorf("multipart upload error: %v", err)
			}
			content[0] = firstPartContent

			// overwrite the last part
			lastPartContent := []byte("hello")
			if parts[total-1], err = blob.UploadPart(ctx, key, upload.UploadID, total, lastPartContent); err != nil {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Inspect the embedded backend error for the failing part number
  2. Ensure part size >= the backend minimum (upload.MinPartSize)
  3. Retry the benchmark in case of transient throttling/timeouts
  4. Verify the UploadID is valid and parts are uploaded before CompleteUpload
Defensive patterns

Strategy: retry

Validate before calling

// ensure each part meets the backend minimum size
if len(content) > 0 && len(content[0]) < upload.MinPartSize { /* parts too small */ }

Try / catch

parts[num-1], err = blob.UploadPart(ctx, key, upload.UploadID, num, content[num-1])
if err != nil {
    // retry transient failures before failing the whole upload
    parts[num-1], err = blob.UploadPart(ctx, key, upload.UploadID, num, content[num-1])
    if err != nil { return fmt.Errorf("multipart upload error: %s", err) }
}

Prevention

When it happens

Trigger: `blob.UploadPart(ctx, key, upload.UploadID, num, content[num-1])` fails for any part during the concurrent multipart test — bad upload ID, part size below MinPartSize, timeout, or throttling.

Common situations: Part size smaller than the backend minimum (e.g. <5 MiB on S3); invalid/expired upload ID; concurrent-request throttling or rate limits; network flakiness under parallelism.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/413d814e1413213b. Report an issue: GitHub.