{"record":{"id":"4ed5731ee0017231","repo":"ipfs/kubo","slug":"creating-libp2p-resource-manager-w","errorCode":null,"errorMessage":"creating libp2p resource manager: %w","messagePattern":"creating libp2p resource manager: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/node/libp2p/rcmgr.go","lineNumber":112,"sourceCode":"\t\t\t\t\t\tlog.Errorf(\"failed to parse multiaddr=%v for allowlist, skipping. err=%v\", maStr, err)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tmas = append(mas, ma)\n\t\t\t\t}\n\t\t\t\tropts = append(ropts, rcmgr.WithAllowlistedMultiaddrs(mas))\n\t\t\t\tlog.Infof(\"Setting allowlist to: %v\", mas)\n\t\t\t}\n\n\t\t\tif os.Getenv(\"LIBP2P_DEBUG_RCMGR\") != \"\" {\n\t\t\t\ttraceFilePath := filepath.Join(repoPath, NetLimitTraceFilename)\n\t\t\t\tropts = append(ropts, rcmgr.WithTrace(traceFilePath))\n\t\t\t}\n\n\t\t\tlimiter := rcmgr.NewFixedLimiter(limitConfig)\n\n\t\t\tmanager, err = rcmgr.NewResourceManager(limiter, ropts...)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, opts, fmt.Errorf(\"creating libp2p resource manager: %w\", err)\n\t\t\t}\n\t\t\tlrm := &loggingResourceManager{\n\t\t\t\tlogger:   &logging.Logger(\"resourcemanager\").SugaredLogger,\n\t\t\t\tdelegate: manager,\n\t\t\t}\n\t\t\tlrm.start(helpers.LifecycleCtx(mctx, lc))\n\t\t\tmanager = lrm\n\t\t} else {\n\t\t\trcmgrLogger.Info(\"go-libp2p resource manager protection disabled\")\n\t\t\tmanager = &network.NullResourceManager{}\n\t\t}\n\n\t\topts.Opts = append(opts.Opts, libp2p.ResourceManager(manager))\n\n\t\tlc.Append(fx.Hook{\n\t\t\tOnStop: func(ctx context.Context) error {\n\t\t\t\treturn shutdown.CloseWithCtx(ctx, \"resource-manager\", manager.Close)\n\t\t\t},","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/node/libp2p/rcmgr.go#L94-L130","documentation":"Fired during node construction (rcmgr construction in core/node/libp2p) when rcmgr.NewResourceManager fails to build the libp2p resource manager from the fixed limiter and options (e.g. invalid allowlist state or limiter configuration). It wraps the underlying error and prevents daemon startup, since the resource manager is mandatory.","triggerScenarios":"Thrown at core/node/libp2p/rcmgr.go:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check Swarm.ResourceMgr.Allowlist entries are valid multiaddrs","Unset LIBP2P_DEBUG_RCMGR if the trace file path is not writable","Simplify Swarm.ResourceMgr config to defaults and re-add custom settings step by step"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}