ipfs/kubo · error

unrecognized Swarm.ConnMgr.Type: %q

Error message

unrecognized Swarm.ConnMgr.Type: %q

What it means

Kubo validates `Swarm.ConnMgr.Type` during libp2p node construction and only supports the known connection manager types (e.g. "none", "basic", and the default). Any other string aborts fx dependency graph construction with this error. It is thrown early at daemon start so a typo cannot silently disable connection management.

Source

Thrown at core/node/groups.go:55

)

func LibP2P(bcfg *BuildCfg, cfg *config.Config, userResourceOverrides rcmgr.PartialLimitConfig) fx.Option {
	var connmgr fx.Option

	// set connmgr based on Swarm.ConnMgr.Type
	connMgrType := cfg.Swarm.ConnMgr.Type.WithDefault(config.DefaultConnMgrType)
	switch connMgrType {
	case "none":
		connmgr = fx.Options() // noop
	case "", "basic":
		grace := cfg.Swarm.ConnMgr.GracePeriod.WithDefault(config.DefaultConnMgrGracePeriod)
		low := int(cfg.Swarm.ConnMgr.LowWater.WithDefault(config.DefaultConnMgrLowWater))
		high := int(cfg.Swarm.ConnMgr.HighWater.WithDefault(config.DefaultConnMgrHighWater))
		silence := cfg.Swarm.ConnMgr.SilencePeriod.WithDefault(config.DefaultConnMgrSilencePeriod)
		connmgr = fx.Provide(libp2p.ConnectionManager(low, high, grace, silence))

	default:
		return fx.Error(fmt.Errorf("unrecognized Swarm.ConnMgr.Type: %q", connMgrType))
	}

	// parse PubSub config

	ps, disc := fx.Options(), fx.Options()
	if bcfg.getOpt("pubsub") || bcfg.getOpt("ipnsps") {
		disc = fx.Provide(libp2p.TopicDiscovery())

		var pubsubOptions []pubsub.Option
		pubsubOptions = append(
			pubsubOptions,
			pubsub.WithMessageSigning(!cfg.Pubsub.DisableSigning),
			pubsub.WithSeenMessagesTTL(cfg.Pubsub.SeenMessagesTTL.WithDefault(pubsub.TimeCacheDuration)),
		)

		var seenMessagesStrategy timecache.Strategy
		configSeenMessagesStrategy := cfg.Pubsub.SeenMessagesStrategy.WithDefault(config.DefaultSeenMessagesStrategy)
		switch configSeenMessagesStrategy {

View on GitHub (pinned to 329838acdf)

Solutions

  1. Set `ipfs config Swarm.ConnMgr.Type basic` (or "none" to disable), matching a supported value exactly (lowercase)
  2. Check `docs/config.md` for the supported Swarm.ConnMgr.Type values in your Kubo version
  3. If the value came from an upgrade guide, re-apply the recommended default (`ipfs config --json Swarm.ConnMgr` reset or explicit valid value)

Example fix

// before (config.json)
"ConnMgr": { "Type": "basics", "LowWater": 200, "HighWater": 500 }
// after
"ConnMgr": { "Type": "basic", "LowWater": 200, "HighWater": 500 }
Defensive patterns

Strategy: validation

Validate before calling

t, _ := cfg.Swarm.ConnMgr.Type.WithDefault(config.DefaultConnMgrType)
valid := []string{"", "none", "basic"}
if !slices.Contains(valid, t) {
	return fmt.Errorf("Swarm.ConnMgr.Type %q not in %v", t, valid)
}

Prevention

When it happens

Trigger: `Swarm.ConnMgr.Type` in the config contains an unrecognized value; the switch in LibP2P group construction falls to the default case and returns fx.Error.

Common situations: Typo like "basics" or "Basic" in the config; copying config from an older/newer Kubo version or another implementation with different connmgr names.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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