{"record":{"id":"8b4dfc938f391102","repo":"juicedata/juicefs","slug":"not-found-local-ip-s","errorCode":null,"errorMessage":"not found local ip: %s","messagePattern":"not found local ip: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/sync/cluster.go","lineNumber":336,"sourceCode":"\t})\n\tvar addr string\n\tu, err := url.Parse(\"ssh://\" + config.Workers[0])\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid worker address %s: %s\", config.Workers[0], err)\n\t}\n\tif config.ManagerAddr != \"\" {\n\t\taddr = config.ManagerAddr\n\t\tif strings.HasPrefix(addr, \":\") || strings.Contains(addr, \"0.0.0.0\") {\n\t\t\tip, err := utils.GetLocalIp(net.JoinHostPort(u.Host, \"22\"))\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"get local ip: %s\", err)\n\t\t\t}\n\t\t\taddr = ip + addr\n\t\t}\n\t} else {\n\t\tip, err := utils.GetLocalIp(net.JoinHostPort(u.Host, \"22\"))\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"not found local ip: %s\", err)\n\t\t}\n\t\tlogger.Debugf(\"Use local ip %s\", ip)\n\t\taddr = ip\n\t}\n\n\tif !strings.Contains(addr, \":\") {\n\t\taddr += \":\"\n\t}\n\n\tl, err := net.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"listen: %s\", err)\n\t}\n\tlogger.Infof(\"Listen at %s\", l.Addr())\n\tgo func() { _ = http.Serve(l, mux) }()\n\treturn l.Addr().String(), nil\n}\n","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/sync/cluster.go#L318-L354","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Explicitly pass --manager-addr with a reachable IP:port so the port-22 probe is not needed","Open outbound access to the worker's port 22 or fix DNS/hosts resolution for the worker hostname","Ensure the manager host has a non-loopback interface with a route to the workers"],"exampleFix":"// before\njuicefs sync --worker worker1 src dst\n// after\njuicefs sync --worker worker1 --manager-addr 10.0.0.5:9000 src dst","handlingStrategy":"validation","validationCode":"// Confirm a resolvable worker and route before starting without --manager-addr\nif _, err := net.LookupHost(firstWorker); err != nil {\n\t// set --manager-addr explicitly\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer explicitly setting --manager-addr in firewalled/containerized environments","Verify outbound connectivity to worker port 22 or pick a network where it is open","Check `ip addr` shows a non-loopback interface before launching distributed sync"],"tags":["network","ip-resolution","distributed-sync"],"backgroundTag":"missing-config-value","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}