juicedata/juicefs · error

readlink %s from %s: %w

Error message

readlink %s from %s: %w

What it means

Returned by produceSingleObject in `juicefs sync` when, after a Head miss on a link-configured source, resolving the symlink target via Readlink also fails. The wrapped error names the key and source; sync of that single object is abandoned.

Source

Thrown at pkg/sync/sync.go:1935

	close(prefixs)

	wg.Wait()
	listedPrefix.Done()
	return nil
}

var errDirSuffix = errors.New("dir miss suffix '/'")
var ignoreFiles int64

func produceSingleObject(tasks chan<- object.Object, src, dst object.ObjectStorage, key string, config *Config, checkpointMgr *CheckpointManager) error {
	obj, err := src.Head(ctx, key)
	if err != nil {
		if config.Links && (errors.Is(err, utils.ErrExtlink) || errors.Is(err, syscall.ENOTSUP) || errors.Is(err, os.ErrNotExist)) {
			if sl, ok := src.(object.SupportSymlink); ok {
				if target, e := sl.Readlink(key); e == nil {
					obj, err = object.NewSymlink(key, target), nil
				} else {
					err = fmt.Errorf("readlink %s from %s: %w", key, src, e)
				}
			}
		}
		if err != nil {
			logger.Warnf("head %s from %s: %s", key, src, err)
			return err
		}
	}
	if obj.IsDir() && (!config.Links || !obj.IsSymlink()) {
		// only `files-from` will hit this case
		if !strings.HasSuffix(key, "/") {
			return errDirSuffix
		}
		if !config.Dirs {
			return nil
		}
	}
	var srckeys = make(chan object.Object, 1)

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Verify the source object/symlink exists and is readable
  2. Exclude the broken path or fix it at the source, then re-run sync
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at pkg/sync/sync.go:1935 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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