ipfs/kubo · error
unknown pubsub router %s
Error message
unknown pubsub router %s
What it means
`Pubsub.Router` chooses the gossipsub/floodsub router implementation. The switch accepts "" (default), "gossipsub", and "floodsub"; any other value fails node construction. Thrown so an unsupported router name cannot silently degrade pubsub behavior.
Source
Thrown at core/node/groups.go:91
switch configSeenMessagesStrategy {
case config.LastSeenMessagesStrategy:
seenMessagesStrategy = timecache.Strategy_LastSeen
case config.FirstSeenMessagesStrategy:
seenMessagesStrategy = timecache.Strategy_FirstSeen
default:
return fx.Error(fmt.Errorf("unsupported Pubsub.SeenMessagesStrategy %q", configSeenMessagesStrategy))
}
pubsubOptions = append(pubsubOptions, pubsub.WithSeenMessagesStrategy(seenMessagesStrategy))
switch cfg.Pubsub.Router {
case "":
fallthrough
case "gossipsub":
ps = fx.Provide(libp2p.GossipSub(pubsubOptions...))
case "floodsub":
ps = fx.Provide(libp2p.FloodSub(pubsubOptions...))
default:
return fx.Error(fmt.Errorf("unknown pubsub router %s", cfg.Pubsub.Router))
}
}
autonat := fx.Options()
switch cfg.AutoNAT.ServiceMode {
default:
panic("BUG: unhandled autonat service mode")
case config.AutoNATServiceDisabled:
case config.AutoNATServiceUnset:
// TODO
//
// We're enabling the AutoNAT service by default on _all_ nodes
// for the moment.
//
// We should consider disabling it by default if the dht is set
// to dhtclient.
fallthroughView on GitHub (pinned to 329838acdf)
Solutions
- Set `ipfs config Pubsub.Router gossipsub` (recommended) or "floodsub"
- Clear the value (`ipfs config Pubsub.Router ""`) to use the default gossipsub
- Check docs/config.md for supported router values in this Kubo version
Example fix
// before (config.json)
"Pubsub": { "Router": "randomsub" }
// after
"Pubsub": { "Router": "gossipsub" } Defensive patterns
Strategy: validation
Validate before calling
switch r := cfg.Pubsub.Router; r {
case "", "gossipsub", "floodsub":
// ok
default:
return fmt.Errorf("Pubsub.Router %q unsupported", r)
} Prevention
- Use gossipsub (default) or floodsub only
- Clear Pubsub.Router to get the default instead of guessing names
- Check docs/config.md after Kubo upgrades
When it happens
Trigger: `Pubsub.Router` set to an unknown string (e.g. "randomsub", "flood", "gossip") while pubsub is enabled in the LibP2P fx group.
Common situations: Typo; copying configuration for a different IPFS implementation; expecting experimental routers to exist when they are not compiled in.
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
- experimental pubsub feature not enabled, run daemon with --e
- unrecognized Swarm.ConnMgr.Type: %q
- unsupported Pubsub.SeenMessagesStrategy %q
- incorrectly formatted address filter in config: %s
- unrecognized reachability option: %s
AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03).
Data as JSON: /api/errors/583194624af089a5.
Report an issue: GitHub.