{"record":{"id":"12e4f0ffb7e62402","repo":"juicedata/juicefs","slug":"invalid-worker-address-s-s","errorCode":null,"errorMessage":"invalid worker address %s: %s","messagePattern":"invalid worker address (.+?): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/sync/cluster.go","lineNumber":322,"sourceCode":"\t\tsrcDelayDelMu.Unlock()\n\t\tif checkpointMgr != nil {\n\t\t\tfor key, state := range r.MultipartUploads {\n\t\t\t\tcheckpointMgr.PutMultipartCheckpoint(key, state)\n\t\t\t}\n\t\t\tfor _, key := range r.CompletedKeys {\n\t\t\t\tcheckpointMgr.MarkCompleted(key)\n\t\t\t}\n\t\t\tfor _, key := range r.FailedKeys {\n\t\t\t\tcheckpointMgr.MarkFailed(key)\n\t\t\t}\n\t\t}\n\t\tlogger.Debugf(\"receive stats %+v from %s\", r, req.RemoteAddr)\n\t\t_, _ = w.Write([]byte(\"OK\"))\n\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}","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/sync/cluster.go#L304-L340","documentation":"startManager parses the first worker address as a URL by prefixing it with \"ssh://\". This error is returned when url.Parse rejects the resulting string, meaning the configured worker address is malformed (invalid characters, empty, bad host/port syntax). The distributed sync manager cannot start without at least one valid worker address.","triggerScenarios":"Running `juicefs sync --worker <addr> src dst` where the --worker value (config.Workers[0]) contains characters invalid in a URL host/port — e.g. spaces, stray brackets, \"host:port:extra\", or an empty string.","commonSituations":"Typo in worker hostnames on the command line; pasting a comma- or space-separated list instead of repeating --worker; IPv6 addresses not wrapped in brackets; shell quoting issues.","solutions":["Check the --worker argument for typos and invalid characters; repeat the flag for each worker instead of using separators","Wrap IPv6 addresses in brackets, e.g. --worker \"ssh://[::1]:2222\"","Quote the argument in the shell to avoid splitting/quote artifacts"],"exampleFix":"// before (invalid)\njuicefs sync --worker host1,host2 src dst\n// after\njuicefs sync --worker host1 --worker host2 src dst","handlingStrategy":"validation","validationCode":"// Validate worker addresses before invoking sync\nfor _, w := range workers {\n\tif _, err := url.Parse(\"ssh://\" + w); err != nil {\n\t\treturn fmt.Errorf(\"bad worker address %q: %w\", w, err)\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass one --worker flag per worker; never comma/space-separate hosts","Quote worker addresses in the shell; wrap IPv6 hosts in brackets","Test the worker address with url.Parse before launching distributed sync"],"tags":["network","url","distributed-sync","config"],"backgroundTag":"invalid-url-format","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"}