{"record":{"id":"568c9a51b0815a1a","repo":"ipfs/kubo","slug":"not-a-file-node-q","errorCode":null,"errorMessage":"not a file node: %q","messagePattern":"not a file node: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/ipfs/kubo/add_migrations.go","lineNumber":156,"sourceCode":"\t\terr = ipfsGet(ctx, ufs, ipfsPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc ipfsGet(ctx context.Context, ufs coreiface.UnixfsAPI, ipfsPath path.Path) error {\n\tnd, err := ufs.Get(ctx, ipfsPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer nd.Close()\n\n\tfnd, ok := nd.(files.File)\n\tif !ok {\n\t\treturn fmt.Errorf(\"not a file node: %q\", ipfsPath)\n\t}\n\t_, err = io.Copy(io.Discard, fnd)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot read migration: %w\", err)\n\t}\n\tfmt.Printf(\"Added migration file: %q\\n\", ipfsPath)\n\treturn nil\n}\n","sourceCodeStart":138,"sourceCodeEnd":165,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/cmd/ipfs/kubo/add_migrations.go#L138-L165","documentation":"ipfsGet retrieves a migration artifact by path from the temp node via the UnixFS Get API and expects the resulting node to be a regular file (files.File). If the node is a directory or other node type, the type assertion fails and this error is returned.","triggerScenarios":"The path fetched from the migration peer resolves to a non-file UnixFS node — e.g. a directory — so nd.(files.File) does not hold during migration file ingestion.","commonSituations":"A migration release asset unpacked into a directory instead of a single binary; the fetched path pointing at a wrapping directory; corrupted or mislabeled dist artifacts.","solutions":["Point the fetcher at the migration binary file itself, not a containing directory","Verify the downloaded artifact on the temp node (`ipfs ls <path>`); re-fetch if it's a directory","Re-run with --migrate to get fresh artifacts from dist.ipfs.tech","Run migrations with the external fs-repo-migrations tool if the dist layout changed"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"st, _ := exec.Command(\"ipfs\", \"--config\", tmpPath, \"ls\", migrationPath).Output()\nif st != nil && strings.HasPrefix(string(st), \"dir/\") {\n    return errors.New(\"fetched migration path is a directory\")\n}","typeGuard":"fnd, ok := nd.(files.File)\nif !ok {\n    return fmt.Errorf(\"not a file node: %T\", nd)\n}","tryCatchPattern":null,"preventionTips":["Fetch the migration binary file, not its parent directory","Inspect `ipfs ls` of the fetched path before ingesting","Re-download artifacts if the dist layout changed"],"tags":["migrations","unixfs","type-assertion"],"backgroundTag":"not-a-file-node","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"}