{"record":{"id":"9ae56f84d57a2e04","repo":"juicedata/juicefs","slug":"invalid-nfs-address-s","errorCode":null,"errorMessage":"invalid NFS address %s","messagePattern":"invalid NFS address (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/nfs.go","lineNumber":468,"sourceCode":"\t\treturn n.findOwnerGroup(st)\n\t}\n\tif st, match := info.Sys().(*nfs.Fattr); match {\n\t\treturn n.findOwnerGroup(st)\n\t}\n\treturn \"\", \"\"\n}\n\nfunc newNFSStore(addr, username, pass, token string) (ObjectStorage, error) {\n\tif username == \"\" {\n\t\tu, err := user.Current()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"current user: %s\", err)\n\t\t}\n\t\tusername = u.Username\n\t}\n\tb := strings.Split(addr, \":\")\n\tif len(b) != 2 {\n\t\treturn nil, fmt.Errorf(\"invalid NFS address %s\", addr)\n\t}\n\thost := b[0]\n\tpath := b[1]\n\tmount, err := nfs.DialMount(host, time.Second*3)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to dial MOUNT service %s: %v\", addr, err)\n\t}\n\tauth := rpc.NewAuthUnix(username, uint32(utils.GetCurrentUID()), uint32(utils.GetCurrentGID()))\n\ttarget, err := mount.Mount(path, auth.Auth())\n\ttarget.Config.DirCount = 1 << 17\n\t// Readdir returns up to 1M at a time, even if MaxCount is set larger\n\ttarget.Config.MaxCount = 1 << 20\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to mount %s: %v\", addr, err)\n\t}\n\tumask := utils.GetUmask()\n\treturn &nfsStore{\n\t\tusername: username,","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/nfs.go#L450-L486","documentation":"newNFSStore expects the address in 'host:/export/path' form; it splits on ':' and requires exactly two parts. Any other count — missing colon, extra colons (e.g. unbracketed IPv6), or multiple path colons — yields 'invalid NFS address'.","triggerScenarios":"Passing addresses like 'nfsserver' (no colon), 'host:/a:/b', or an unbracketed IPv6 address 'fd00::1:/export' to newNFSStore / an nfs:// URL.","commonSituations":"Omitting the export path; pasting an IPv6 NFS server address without handling the colons; trailing colon or whitespace in config.","solutions":["Use the standard 'host:/export/path' form, e.g. 'nfsserver:/export/data'.","For IPv6 servers, use a resolvable hostname instead of a literal address, or normalize the address so exactly one colon separates host and path.","Trim whitespace and verify the endpoint contains exactly one colon."],"exampleFix":"// before\nnewNFSStore(\"fd00::1:/export\", \"user\", \"\", \"\")\n// after\nnewNFSStore(\"nfs6.internal:/export\", \"user\", \"\", \"\") // hostname instead of IPv6 literal","handlingStrategy":"validation","validationCode":"if strings.Count(addr, \":\") != 1 || !strings.Contains(addr, \":/\") {\n\treturn fmt.Errorf(\"NFS address %q must be host:/export/path\", addr)\n}","typeGuard":null,"tryCatchPattern":"store, err := newNFSStore(addr, user, pass, \"\")\nif err != nil && strings.Contains(err.Error(), \"invalid NFS address\") {\n\treturn fmt.Errorf(\"use host:/path form for NFS address, got %q\", addr)\n}","preventionTips":["Use the canonical host:/export form everywhere NFS endpoints are configured.","Use hostnames instead of raw IPv6 literals to avoid extra colons.","Trim whitespace when parsing addresses from config."],"tags":["nfs","url-format","configuration"],"backgroundTag":"invalid-argument-format","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}