ipfs/kubo · error

Routing.AcceleratedDHTClient option is set even tho Routing.

Error message

Routing.AcceleratedDHTClient option is set even tho Routing.Type is custom, using custom .AcceleratedDHTClient needs to be set on DHT routers individually

What it means

When Routing.Type=custom, kubo builds routing from Routing.Routers definitions, and Routing.AcceleratedDHTClient is not a global knob anymore — it must be set inside each DHT router's parameters. Setting it globally alongside a custom routing type is rejected.

Source

Thrown at cmd/ipfs/kubo/daemon.go:509

	case routingOptionSupernodeKwd:
		return errors.New("supernode routing was never fully implemented and has been removed")
	case routingOptionDefaultKwd, routingOptionAutoKwd:
		ncfg.Routing = libp2p.ConstructDefaultRouting(cfg, libp2p.DHTOption)
	case routingOptionAutoClientKwd:
		ncfg.Routing = libp2p.ConstructDefaultRouting(cfg, libp2p.DHTClientOption)
	case routingOptionDHTClientKwd:
		ncfg.Routing = libp2p.DHTClientOption
	case routingOptionDHTKwd:
		ncfg.Routing = libp2p.DHTOption
	case routingOptionDHTServerKwd:
		ncfg.Routing = libp2p.DHTServerOption
	case routingOptionNoneKwd:
		ncfg.Routing = libp2p.NilRouterOption
	case routingOptionDelegatedKwd:
		ncfg.Routing = libp2p.ConstructDelegatedOnlyRouting(cfg)
	case routingOptionCustomKwd:
		if cfg.Routing.AcceleratedDHTClient.WithDefault(config.DefaultAcceleratedDHTClient) {
			return errors.New("Routing.AcceleratedDHTClient option is set even tho Routing.Type is custom, using custom .AcceleratedDHTClient needs to be set on DHT routers individually")
		}
		ncfg.Routing = libp2p.ConstructDelegatedRouting(
			cfg.Routing.Routers,
			cfg.Routing.Methods,
			cfg.Identity.PeerID,
			cfg.Addresses,
			cfg.Identity.PrivKey,
			cfg.HTTPRetrieval.Enabled.WithDefault(config.DefaultHTTPRetrievalEnabled),
		)
	default:
		return fmt.Errorf("unrecognized routing option: %s", routingOption)
	}

	// Resolve agent version suffix:
	// Version.AgentSuffix > --agent-version-suffix > implicit (build origin).
	versionSuffixFromCli, _ := req.Options[agentVersionSuffix].(string)
	versionSuffix := cfg.Version.AgentSuffix.WithDefault(versionSuffixFromCli)
	if versionSuffix == "" {

View on GitHub (pinned to 329838acdf)

Solutions

  1. Set Routing.AcceleratedDHTClient=false (or remove the key) in the config
  2. Enable the accelerated client per-router: add "AcceleratedDHTClient": true in the Parameters of the DHT router under Routing.Routers
  3. Alternatively change Routing.Type away from custom if you want the global option to apply

Example fix

// before
"Routing": { "Type": "custom", "AcceleratedDHTClient": true, ... }
// after
"Routing": { "Type": "custom", "Routers": { "dht": { "Type": "dht", "Parameters": { "AcceleratedDHTClient": true } } }, ... }
Defensive patterns

Strategy: validation

Validate before calling

cfg, _ := ipfsConfigShow()
if cfg.Routing.Type == "custom" && cfg.Routing.AcceleratedDHTClient == true {
    // move AcceleratedDHTClient into Routing.Routers.<name>.Parameters instead
}

Prevention

When it happens

Trigger: `ipfs daemon --routing=custom` (or Routing.Type="custom") while config has Routing.AcceleratedDHTClient=true.

Common situations: Users who first enabled the accelerated DHT client, then switched Routing.Type to custom without removing the old flag; config templating that always sets AcceleratedDHTClient.

Related errors


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