{"record":{"id":"9c96cb189428633c","repo":"juicedata/juicefs","slug":"unable-to-dial-mount-service-s-v","errorCode":null,"errorMessage":"unable to dial MOUNT service %s: %v","messagePattern":"unable to dial MOUNT service (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/nfs.go","lineNumber":474,"sourceCode":"}\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,\n\t\thost:     host,\n\t\troot:     path,\n\t\tfmode:    os.FileMode(0666 &^ umask),\n\t\tdmode:    os.FileMode(0777 &^ umask),\n\t\ttarget:   target}, nil\n}","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/nfs.go#L456-L492","documentation":"After parsing the address, newNFSStore dials the NFS MOUNT service (rpcbind/portmapper on the host, 3s timeout). If the dial fails — no route, portmapper not running, firewall, wrong host — the wrapped error is returned.","triggerScenarios":"newNFSStore targeting a host where rpcbind (port 111) or mountd is unreachable: server down, NFS service not started, firewall dropping TCP/UDP 111 or 2049, or DNS failure resolving the hostname.","commonSituations":"Connecting to an NFS server from a network that blocks port 111; rpcbind disabled on the server; typo'd hostname; containers/Kubernetes without egress to the NFS host.","solutions":["Verify connectivity: 'rpcinfo -p <host>' and 'showmount -e <host>' from the client; open ports 111 and the NFS ports in the firewall.","Start rpcbind/mountd on the server (systemctl enable --now rpcbind nfs-server).","Check the hostname/IP for typos and DNS resolution; confirm reachability (ping, 'telnet host 111')."],"exampleFix":"// before\nnewNFSStore(\"wrong-host:/export\", \"user\", \"\", \"\")\n// after\n// verify first: rpcinfo -p nfsserver && showmount -e nfsserver\nnewNFSStore(\"nfsserver:/export\", \"user\", \"\", \"\")","handlingStrategy":"retry","validationCode":"conn, err := net.DialTimeout(\"tcp\", net.JoinHostPort(host, \"111\"), 3*time.Second)\nif err != nil {\n\treturn fmt.Errorf(\"rpcbind unreachable on %s: %w\", host, err)\n}\nconn.Close()","typeGuard":null,"tryCatchPattern":"store, err := newNFSStore(addr, user, pass, \"\")\nif err != nil && strings.Contains(err.Error(), \"unable to dial MOUNT\") {\n\t// back off and retry; server or network may be temporarily down\n\ttime.Sleep(2 * time.Second)\n\tstore, err = newNFSStore(addr, user, pass, \"\")\n}","preventionTips":["Check port 111 (rpcbind) and NFS ports are open between client and server.","Ensure rpcbind/mountd are running on the NFS server before mounting.","Resolve hostnames before dialing and use short, explicit timeouts to fail fast."],"tags":["nfs","network","rpc","connection"],"backgroundTag":"connection-refused","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"}