{"record":{"id":"bbb0c1310dd66e18","repo":"ipfs/kubo","slug":"mountfuse-constructnode-failed-s","errorCode":null,"errorMessage":"mountFuse: ConstructNode() failed: %s","messagePattern":"mountFuse: ConstructNode\\(\\) failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/ipfs/kubo/daemon.go","lineNumber":1268,"sourceCode":"\tnsdir, found := req.Options[ipnsMountKwd].(string)\n\tif !found {\n\t\tnsdir = cfg.Mounts.IPNS\n\t}\n\tif err := checkFusePath(\"Mounts.IPNS\", nsdir); err != nil {\n\t\treturn err\n\t}\n\n\tmfsdir, found := req.Options[mfsMountKwd].(string)\n\tif !found {\n\t\tmfsdir = cfg.Mounts.MFS\n\t}\n\tif err := checkFusePath(\"Mounts.MFS\", mfsdir); err != nil {\n\t\treturn err\n\t}\n\n\tnode, err := cctx.ConstructNode()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"mountFuse: ConstructNode() failed: %s\", err)\n\t}\n\n\terr = nodeMount.Mount(node, fsdir, nsdir, mfsdir)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Extra space after \"MFS\" so \"mounted at:\" lines up with IPFS and\n\t// IPNS in the column above. Matches MountCmd's output formatter.\n\tfmt.Printf(\"IPFS mounted at: %s\\n\", fsdir)\n\tfmt.Printf(\"IPNS mounted at: %s\\n\", nsdir)\n\tfmt.Printf(\"MFS  mounted at: %s\\n\", mfsdir)\n\treturn nil\n}\n\nfunc checkFusePath(name, path string) error {\n\tif path == \"\" {\n\t\treturn fmt.Errorf(\"%s path cannot be empty\", name)\n\t}","sourceCodeStart":1250,"sourceCodeEnd":1286,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/cmd/ipfs/kubo/daemon.go#L1250-L1286","documentation":"mountFuse calls cctx.ConstructNode() to build the full IPFS node before mounting FUSE filesystems. If node construction fails — bad repo layout, unsupported repo version, datastore errors, invalid config values — the error is wrapped as \"mountFuse: ConstructNode() failed\". Mounting requires a fully constructed node because the mounts serve live blockstore/MFS data.","triggerScenarios":"Running `ipfs daemon --mount` when node construction fails: repo needs migration (repo version newer than binary), datastore is locked by another daemon, corrupt datastore, or invalid config values that fail validation during core construction.","commonSituations":"Attaching a mount to a repo while another daemon already holds the repo lock; running an older kubo against a repo written by a newer version; disk or datastore corruption; invalid Datastore or Mounts config entries.","solutions":["Run `ipfs repo fsck` and check for a stale repo lock; kill any other daemon using the same IPFS_PATH","Run `ipfs repo migrate` (or download the matching kubo version) if the repo version is newer than the binary","Read the wrapped inner error (%s) — it names the actual construction failure and fix that specific issue","Verify the repo datastore is intact and the disk is writable"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check: repo lock and version\nif _, err := os.Stat(filepath.Join(ipfsPath, \"repo.lock\")); err == nil {\n\t// another daemon may hold the lock; stop it first\n}\nipfsRepoVersion, _ := exec.Command(\"ipfs\", \"repo\", \"version\").Output()","typeGuard":null,"tryCatchPattern":"if err := mountFuse(req, cctx); err != nil {\n\tif strings.Contains(err.Error(), \"ConstructNode() failed\") {\n\t\tlog.Printf(\"node construction failed: %v\", err) // inner error names the real cause\n\t}\n\treturn err\n}","preventionTips":["Stop existing daemons before starting one with --mount (single repo lock holder)","Keep the kubo binary version >= repo version; run `ipfs repo migrate` after upgrades","Run `ipfs repo fsck` if construction failures persist","Validate datastore config changes on a scratch repo before applying them"],"tags":["go","daemon","fuse","mount","node-construction"],"backgroundTag":"node-construction-failed","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}