juicedata/juicefs · error

src get: %s

Error message

src get: %s

What it means

Wraps an error from src.Get(ctx, key, offset, length): the sync worker could not fetch the byte range of the object from the SOURCE storage while comparing it with the destination. The underlying storage error (network, 404, 403, throttling) is embedded after 'src get: '.

Source

Thrown at pkg/sync/sync.go:555

	}
	return chksum, nil
}

func compObjPartBinary(src, dst object.ObjectStorage, key string, abort chan struct{}, offset, length int64) error {
	if limiter != nil {
		limiter.Wait(length)
	}
	select {
	case <-abort:
		return fmt.Errorf("aborted")
	case concurrent <- 1:
		defer func() {
			<-concurrent
		}()
	}
	in, err := src.Get(ctx, key, offset, length)
	if err != nil {
		return fmt.Errorf("src get: %s", err)
	}
	defer in.Close()
	in2, err := dst.Get(ctx, key, offset, length)
	if err != nil {
		return fmt.Errorf("dest get: %s", err)
	}
	defer in2.Close()

	buf := bufPool.Get().(*[]byte)
	defer bufPool.Put(buf)
	buf2 := bufPool.Get().(*[]byte)
	defer bufPool.Put(buf2)
	for left := int(length); left > 0; left -= bufferSize {
		bs := bufferSize
		if left < bufferSize {
			bs = left
		}
		*buf = (*buf)[:bs]

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Verify source credentials and GetObject permission on the bucket/key.
  2. Confirm the source object still exists (it may have been deleted mid-sync); re-list and retry.
  3. Check network/proxy/TLS configuration for the source endpoint.
  4. Increase retries or run try(3) wrapped copy if errors are transient throttling (429/503).

Example fix

// before
in, err := src.Get(ctx, key, offset, length)
if err != nil {
	return fmt.Errorf("src get: %s", err)
}
// after: retry transient failures before giving up
err = try(3, func() error {
	in, err = src.Get(ctx, key, offset, length)
	return err
})
if err != nil {
	return fmt.Errorf("src get: %s", err)
}
Defensive patterns

Strategy: retry

Validate before calling

// preflight before sync
head, err := src.Head(ctx, key)
if err != nil {
	return fmt.Errorf("source unreadable for %s: %w", key, err)
}

Try / catch

err := try(3, func() error {
	_, e := src.Get(ctx, key, offset, length)
	return e
})
if err != nil {
	logger.Errorf("persistent src get failure for %s: %v", key, err)
}

Prevention

When it happens

Trigger: Source object missing, credentials lacking GetObject permission, range GET unsupported/rejected by the backend, network interruption or rate limiting during compObjPartBinary.

Common situations: Syncing from S3 with revoked/expired keys; object deleted between listing and copy; self-signed or proxy-mangled TLS; minio endpoint misconfigured.

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/1c1bdc4b02ca5f1f. Report an issue: GitHub.