ipfs/kubo · error

ErrNoResourceMgr

ErrNoResourceMgr

Error message

missing ResourceMgr: make sure the daemon is running with Swarm.ResourceMgr.Enabled

What it means

Sentinel error (libp2p.ErrNoResourceMgr) returned by 'ipfs swarm stats'/'ipfs swarm limit' style commands when the node has no resource manager: the running daemon was started with Swarm.ResourceMgr.Enabled=false (or LIBP2P_RCMGR=0), so there are no stats or limits to inspect.

Source

Thrown at core/node/libp2p/rcmgr.go:30

	"github.com/ipfs/kubo/core/node/helpers"
	"github.com/ipfs/kubo/core/shutdown"
	"github.com/ipfs/kubo/repo"

	logging "github.com/ipfs/go-log/v2"
	"github.com/libp2p/go-libp2p"
	"github.com/libp2p/go-libp2p/core/network"
	"github.com/libp2p/go-libp2p/core/peer"
	"github.com/libp2p/go-libp2p/core/protocol"
	rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
	"github.com/multiformats/go-multiaddr"
	"go.uber.org/fx"
)

var rcmgrLogger = logging.Logger("rcmgr")

const NetLimitTraceFilename = "rcmgr.json.gz"

var ErrNoResourceMgr = errors.New("missing ResourceMgr: make sure the daemon is running with Swarm.ResourceMgr.Enabled")

func ResourceManager(repoPath string, cfg config.SwarmConfig, userResourceOverrides rcmgr.PartialLimitConfig) any {
	return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo) (network.ResourceManager, Libp2pOpts, error) {
		var manager network.ResourceManager
		var opts Libp2pOpts

		enabled := cfg.ResourceMgr.Enabled.WithDefault(true)

		//  ENV overrides Config (if present)
		switch os.Getenv("LIBP2P_RCMGR") {
		case "0", "false":
			enabled = false
		case "1", "true":
			enabled = true
		}

		if enabled {
			log.Debug("libp2p resource manager is enabled")

View on GitHub (pinned to 329838acdf)

Solutions

  1. Enable the resource manager: set Swarm.ResourceMgr.Enabled=true in the config and restart the daemon
  2. Make sure LIBP2P_RCMGR is not set to 0/false in the daemon's environment
  3. The NullResourceManager case also triggers this; a restart with the manager enabled is required
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at core/node/libp2p/rcmgr.go:30 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/15f150a714accbcb. Report an issue: GitHub.