{"record":{"id":"eb2e4e1c6e3d45cd","repo":"ipfs/kubo","slug":"cp-cannot-get-node-from-path-s-s","errorCode":null,"errorMessage":"cp: cannot get node from path %s: %s","messagePattern":"cp: cannot get node from path (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/files.go","lineNumber":546,"sourceCode":"\n\t\tsrc, err := checkContentOrMfsPath(req.Arguments[0])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsrc = strings.TrimRight(src, \"/\")\n\n\t\tdst, err := checkPath(req.Arguments[1])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif dst[len(dst)-1] == '/' {\n\t\t\tdst += gopath.Base(src)\n\t\t}\n\n\t\tnode, err := getNodeFromPath(req.Context, nd, api, src)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"cp: cannot get node from path %s: %s\", src, err)\n\t\t}\n\n\t\t// Sanity-check: ensure root CID is a valid UnixFS (dag-pb or raw block)\n\t\t// Context: https://github.com/ipfs/kubo/issues/10331\n\t\tsrcCidType := node.Cid().Type()\n\t\tswitch srcCidType {\n\t\tcase cid.Raw:\n\t\t\tif _, ok := node.(*dag.RawNode); !ok {\n\t\t\t\treturn errFilesCpInvalidUnixFS\n\t\t\t}\n\t\tcase cid.DagProtobuf:\n\t\t\tif _, ok := node.(*dag.ProtoNode); !ok {\n\t\t\t\treturn errFilesCpInvalidUnixFS\n\t\t\t}\n\t\t\tif _, err = ft.FSNodeFromBytes(node.(*dag.ProtoNode).Data()); err != nil {\n\t\t\t\treturn fmt.Errorf(\"%w: %v\", errFilesCpInvalidUnixFS, err)\n\t\t\t}\n\t\tdefault:","sourceCodeStart":528,"sourceCodeEnd":564,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/files.go#L528-L564","documentation":"`ipfs files cp` could not resolve the source path to a node at all. The error wraps whatever getNodeFromPath returned, indicating the source path (e.g. /ipfs/<CID> or an MFS path) failed to resolve — most commonly because the content is not present locally and the node can't fetch it, or the path is malformed.","triggerScenarios":"Running `ipfs files cp <src> <dst>` where src is an /ipfs/ path whose blocks cannot be retrieved (offline node without local copy, DHT lookup failure), or src is an invalid/unresolvable MFS or IPNS path.","commonSituations":"Running `ipfs files cp` while the daemon is offline and the source CID is not pinned/locally available; typos in the source path; expired or missing IPNS names; content removed by GC.","solutions":["Verify the source resolves: `ipfs cat <src>` or `ipfs ls <src>` first","Start the daemon (`ipfs daemon`) so remote content can be fetched, or provide connectivity","If content was garbage-collected, re-fetch or re-pin it before copying","Check the path syntax: source must be /ipfs/<CID>, /ipns/<name>, or an existing MFS path"],"exampleFix":"// before\nipfs files cp /ipfs/QmXyz... /my-file\n// error: cp: cannot get node from path /ipfs/QmXyz...: ...\n\n// after: ensure content is locally available first\nipfs dag get /ipfs/QmXyz... > /dev/null  # warms the local cache or reports the real fetch error\nipfs files cp /ipfs/QmXyz... /my-file","handlingStrategy":"validation","validationCode":"// ensure the source resolves before cp\nif err := run(\"ipfs\", \"dag\", \"get\", src); err != nil {\n    return fmt.Errorf(\"source %s not resolvable: %w\", src, err)\n}","typeGuard":null,"tryCatchPattern":"if err := ipfsFilesCp(src, dst); err != nil {\n    if strings.Contains(err.Error(), \"cannot get node from path\") {\n        // check daemon running / local copy present, then retry\n    }\n}","preventionTips":["Verify the source with `ipfs cat` or `ipfs ls` before cp","Run with the daemon up so remote content can be fetched","Pin source content before copying to survive GC"],"tags":["mfs","cli","path-resolution"],"backgroundTag":"path-resolution-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"}