{"record":{"id":"957f903afe35d42d","repo":"ipfs/kubo","slug":"failed-to-initialize-ephemeral-node-s","errorCode":null,"errorMessage":"failed to initialize ephemeral node: %s","messagePattern":"failed to initialize ephemeral node: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher.go","lineNumber":210,"sourceCode":"\n\t// Disable listening for inbound connections\n\tcfg.Addresses.Gateway = []string{}\n\tcfg.Addresses.API = []string{}\n\tcfg.Addresses.Swarm = []string{tempNodeTCPAddr}\n\n\tif len(bootstrap) != 0 {\n\t\tcfg.Bootstrap = bootstrap\n\t}\n\n\tif len(peers) != 0 {\n\t\tcfg.Peering.Peers = peers\n\t}\n\n\t// Assumes that repo plugins are already loaded\n\terr = fsrepo.Init(dir, cfg)\n\tif err != nil {\n\t\tos.RemoveAll(dir)\n\t\treturn \"\", fmt.Errorf(\"failed to initialize ephemeral node: %s\", err)\n\t}\n\n\treturn dir, nil\n}\n\nfunc (f *IpfsFetcher) startTempNode(ctx context.Context) error {\n\t// Open the repo\n\tr, err := fsrepo.Open(f.ipfsTmpDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create a new lifetime context that is used to stop the temp ipfs node\n\tctxIpfsLife, cancel := context.WithCancel(context.Background())\n\n\t// Construct the node\n\tnode, err := core.NewNode(ctxIpfsLife, &core.BuildCfg{\n\t\tOnline:  true,","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher.go#L192-L228","documentation":"initTempNode fails with this when fsrepo.Init cannot initialize the ephemeral repo for the temp node; the created temp dir is removed and the underlying error is wrapped. Note the comment: repo plugins must already be loaded, otherwise init can fail.","triggerScenarios":"Repo plugins not loaded before starting the fetcher; invalid generated config for the temp node; permission problems writing into the temp dir; fsrepo lock issues.","commonSituations":"Running migrations in a stripped-down build where datastore/plugins are unavailable; concurrent migrations racing on fsrepo state; corrupted TMPDIR contents.","solutions":["Ensure plugins are initialized (plugin loader run) before invoking IpfsFetcher/migrations","Read the wrapped %s error for the root cause (e.g. permissions, unsupported datastore) and fix that","Retry on a clean TMPDIR after removing stale ipfs-temp directories"],"exampleFix":"// before\nfetcher, err := ipfsfetcher.NewIpfsFetcher(ctx, 0) // plugins not yet loaded\n// after\nif err := pluginloader.Initialize(); err != nil { return err }\nfetcher, err := ipfsfetcher.NewIpfsFetcher(ctx, 0)","handlingStrategy":"retry","validationCode":"// plugins must be loaded before initializing the temp repo\nif err := plugins.Init(os.TempDir()); err != nil { return err }","typeGuard":null,"tryCatchPattern":"dir, err := initTempNode(ctx)\nif err != nil && strings.HasPrefix(err.Error(), \"failed to initialize ephemeral node\") {\n    // inspect wrapped cause; fix permissions/plugins, clear stale ipfs-temp dirs, retry\n}","preventionTips":["Load repo plugins before starting migrations","Initialize the fetcher in an environment writable by the current user","Avoid concurrent migrations against the same installation"],"tags":["go","migrations","repo","plugins"],"backgroundTag":"repo-init-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"}