{"record":{"id":"098aca122eeb65be","repo":"ipfs/kubo","slug":"q-is-not-an-ipfs-path","errorCode":null,"errorMessage":"%q is not an IPFS path","messagePattern":"%q is not an IPFS path","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher.go","lineNumber":284,"sourceCode":"\n\treturn nil\n}\n\nfunc parsePath(fetchPath string) (path.Path, error) {\n\tif ipfsPath, err := path.NewPath(fetchPath); err == nil {\n\t\treturn ipfsPath, nil\n\t}\n\n\tu, err := url.Parse(fetchPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%q could not be parsed: %s\", fetchPath, err)\n\t}\n\n\tswitch proto := u.Scheme; proto {\n\tcase \"ipfs\", \"ipld\", \"ipns\":\n\t\treturn path.NewPath(gopath.Join(\"/\", proto, u.Host, u.Path))\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%q is not an IPFS path\", fetchPath)\n\t}\n}\n\nfunc readIpfsConfig(repoRoot *string, userConfigFile string) (bootstrap []string, peers []peer.AddrInfo) {\n\tif repoRoot == nil {\n\t\treturn\n\t}\n\n\tcfgPath, err := config.Filename(*repoRoot, userConfigFile)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\treturn\n\t}\n\n\tcfgFile, err := os.Open(cfgPath)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\treturn","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher.go#L266-L302","documentation":"parsePath parses the string as a URL successfully, but the scheme is not one of \"ipfs\", \"ipld\", or \"ipns\", so the fetcher cannot interpret it as an IPFS path. The migrations fetcher only knows how to resolve these three scheme families.","triggerScenarios":"Calling Fetch with a path whose scheme is http/https, file, or any other non-IPFS scheme, e.g. Fetch(\"https://example.com/ipfs/Qm...\") instead of Fetch(\"/ipfs/Qm...\").","commonSituations":"Passing a full gateway HTTP URL where an IPFS path is expected; using \"dweb:/ipfs/...\" links; misconfiguring Migration.DownloadSources so an IPFS fetcher receives an HTTPS gateway URL.","solutions":["Convert the reference to an IPFS path form: strip the gateway prefix and pass \"/ipfs/<cid>\" (or /ipns/..., /ipld/...).","If you meant an HTTP download, use the HTTP fetcher (NewHttpFetcher) or include the URL in Migration.DownloadSources instead.","Validate the scheme before calling Fetch: parse the URL and check it is ipfs/ipld/ipns."],"exampleFix":"// before\nf.Fetch(\"https://ipfs.io/ipfs/QmHash\")\n// after\nf.Fetch(\"/ipfs/QmHash\")","handlingStrategy":"validation","validationCode":"u, _ := url.Parse(s)\nswitch u.Scheme {\ncase \"ipfs\", \"ipld\", \"ipns\":\n    // OK for ipfsfetcher.Fetch\ndefault:\n    // use HttpFetcher instead\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"is not an IPFS path\") {\n        // fall back to HTTP fetcher\n    }\n}","preventionTips":["Pass IPFS references as /ipfs/<cid> paths, not gateway URLs","Route http(s) downloads to NewHttpFetcher, not the IPFS fetcher"],"tags":["migrations","ipfs-path","go"],"backgroundTag":"invalid-ipfs-path","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"}