juicedata/juicefs · error

not found local ip: %s

Error message

not found local ip: %s

What it means

When no ManagerAddr is configured, startManager resolves the local IP by dialing the first worker (utils.GetLocalIp) so it can advertise a manager address workers can reach. This error wraps a resolution failure, meaning the manager host has no usable route/interface toward the worker on port 22.

Source

Thrown at pkg/sync/cluster.go:336

	})
	var addr string
	u, err := url.Parse("ssh://" + config.Workers[0])
	if err != nil {
		return "", fmt.Errorf("invalid worker address %s: %s", config.Workers[0], err)
	}
	if config.ManagerAddr != "" {
		addr = config.ManagerAddr
		if strings.HasPrefix(addr, ":") || strings.Contains(addr, "0.0.0.0") {
			ip, err := utils.GetLocalIp(net.JoinHostPort(u.Host, "22"))
			if err != nil {
				return "", fmt.Errorf("get local ip: %s", err)
			}
			addr = ip + addr
		}
	} else {
		ip, err := utils.GetLocalIp(net.JoinHostPort(u.Host, "22"))
		if err != nil {
			return "", fmt.Errorf("not found local ip: %s", err)
		}
		logger.Debugf("Use local ip %s", ip)
		addr = ip
	}

	if !strings.Contains(addr, ":") {
		addr += ":"
	}

	l, err := net.Listen("tcp", addr)
	if err != nil {
		return "", fmt.Errorf("listen: %s", err)
	}
	logger.Infof("Listen at %s", l.Addr())
	go func() { _ = http.Serve(l, mux) }()
	return l.Addr().String(), nil
}

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Explicitly pass --manager-addr with a reachable IP:port so the port-22 probe is not needed
  2. Open outbound access to the worker's port 22 or fix DNS/hosts resolution for the worker hostname
  3. Ensure the manager host has a non-loopback interface with a route to the workers

Example fix

// before
juicefs sync --worker worker1 src dst
// after
juicefs sync --worker worker1 --manager-addr 10.0.0.5:9000 src dst
Defensive patterns

Strategy: validation

Validate before calling

// Confirm a resolvable worker and route before starting without --manager-addr
if _, err := net.LookupHost(firstWorker); err != nil {
	// set --manager-addr explicitly
}

Prevention

When it happens

Trigger: Distributed sync started with --worker but no --manager-addr; utils.GetLocalIp("worker:22") fails because the manager cannot dial the worker — unreachable host, blocked port 22, DNS failure, or only loopback interfaces exist.

Common situations: Cluster nodes on isolated networks where the sync port works but SSH port 22 is firewalled; running inside containers without outbound routing; hostname typo in --worker.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


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