{"record":{"id":"f53a6bfb979926e2","repo":"netbirdio/netbird","slug":"address-must-be-in-unix-tcp-npipe-path-host-p","errorCode":null,"errorMessage":"address must be in [unix|tcp|npipe]://[path|host:port|name] format: %q","messagePattern":"address must be in \\[unix\\|tcp\\|npipe\\]://\\[path\\|host:port\\|name\\] format: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/service_socket.go","lineNumber":52,"sourceCode":"\t\treturn &socketListener{Listener: listener, network: network, address: path}, nil\n\t}\n\n\tif network == \"unix\" {\n\t\tremoveStaleUnixSocket(address)\n\t}\n\n\tlistener, err := net.Listen(network, address)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &socketListener{Listener: listener, network: network, address: address}, nil\n}\n\nfunc parseListenAddress(addr string) (string, string, error) {\n\tnetwork, address, ok := strings.Cut(addr, \"://\")\n\tif !ok || network == \"\" || address == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"address must be in [unix|tcp|npipe]://[path|host:port|name] format: %q\", addr)\n\t}\n\n\tswitch network {\n\tcase \"unix\", \"tcp\", \"npipe\":\n\t\treturn network, address, nil\n\tdefault:\n\t\treturn \"\", \"\", fmt.Errorf(\"unsupported daemon address protocol: %v\", network)\n\t}\n}\n\nfunc removeStaleUnixSocket(path string) {\n\tstat, err := os.Lstat(path)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\tlog.Debugf(\"stat socket file: %v\", err)\n\t\t}\n\t\treturn\n\t}","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/service_socket.go#L34-L70","documentation":"parseListenAddress requires scheme://target and splits on the first '://'. The error fires when there is no separator at all, or when either side is empty, i.e. the --daemon-addr value is not shaped like unix:///path, tcp://host:port, or npipe://name.","triggerScenarios":"--daemon-addr /var/run/netbird.sock (no scheme), --daemon-addr 127.0.0.1:8080 (host:port without tcp://), --daemon-addr unix:// (empty path), or an empty value after shell quoting ate the rest.","commonSituations":"Migrating from older releases whose address had no scheme; copy-pasting a host:port address from another tool's documentation.","solutions":["Prefix the scheme: unix:///var/run/netbird.sock, tcp://127.0.0.1:8080, or npipe://netbird","Use three slashes for absolute unix paths (unix:// plus /path)","Check shell quoting around the flag value","Reinstall the service with the fixed flag so it persists"],"exampleFix":"# before\nnetbird service run --daemon-addr 127.0.0.1:8080\n# after\nnetbird service run --daemon-addr tcp://127.0.0.1:8080","handlingStrategy":"validation","validationCode":"func hasDaemonAddrScheme(a string) bool {\n\tn, rest, ok := strings.Cut(a, \"://\")\n\treturn ok && n != \"\" && rest != \"\"\n}\n\nif !hasDaemonAddrScheme(daemonAddr) {\n\treturn fmt.Errorf(\"daemon address %q must be scheme://target\", daemonAddr)\n}","typeGuard":"func daemonAddrShape(a string) error {\n\tn, rest, ok := strings.Cut(a, \"://\")\n\tif !ok || n == \"\" || rest == \"\" {\n\t\treturn fmt.Errorf(\"malformed daemon address %q\", a)\n\t}\n\treturn nil\n}","tryCatchPattern":"network, address, err := parseListenAddress(addr)\nif err != nil {\n\t// shape error: rewrite the flag value; retrying the same value cannot succeed\n\treturn err\n}","preventionTips":["Always write daemon addresses with an explicit scheme","Use unix:///abs/path with three slashes on unix systems","Centralize address constants instead of hand-typing them"],"tags":["daemon","socket","configuration","cli","go"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}