{"record":{"id":"603aeb6b64395617","repo":"ipfs/kubo","slug":"routing-accelerateddhtclient-option-is-set-even-th","errorCode":null,"errorMessage":"Routing.AcceleratedDHTClient option is set even tho Routing.Type is custom, using custom .AcceleratedDHTClient needs to be set on DHT routers individually","messagePattern":"Routing\\.AcceleratedDHTClient option is set even tho Routing\\.Type is custom, using custom \\.AcceleratedDHTClient needs to be set on DHT routers individually","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/ipfs/kubo/daemon.go","lineNumber":509,"sourceCode":"\tcase routingOptionSupernodeKwd:\n\t\treturn errors.New(\"supernode routing was never fully implemented and has been removed\")\n\tcase routingOptionDefaultKwd, routingOptionAutoKwd:\n\t\tncfg.Routing = libp2p.ConstructDefaultRouting(cfg, libp2p.DHTOption)\n\tcase routingOptionAutoClientKwd:\n\t\tncfg.Routing = libp2p.ConstructDefaultRouting(cfg, libp2p.DHTClientOption)\n\tcase routingOptionDHTClientKwd:\n\t\tncfg.Routing = libp2p.DHTClientOption\n\tcase routingOptionDHTKwd:\n\t\tncfg.Routing = libp2p.DHTOption\n\tcase routingOptionDHTServerKwd:\n\t\tncfg.Routing = libp2p.DHTServerOption\n\tcase routingOptionNoneKwd:\n\t\tncfg.Routing = libp2p.NilRouterOption\n\tcase routingOptionDelegatedKwd:\n\t\tncfg.Routing = libp2p.ConstructDelegatedOnlyRouting(cfg)\n\tcase routingOptionCustomKwd:\n\t\tif cfg.Routing.AcceleratedDHTClient.WithDefault(config.DefaultAcceleratedDHTClient) {\n\t\t\treturn errors.New(\"Routing.AcceleratedDHTClient option is set even tho Routing.Type is custom, using custom .AcceleratedDHTClient needs to be set on DHT routers individually\")\n\t\t}\n\t\tncfg.Routing = libp2p.ConstructDelegatedRouting(\n\t\t\tcfg.Routing.Routers,\n\t\t\tcfg.Routing.Methods,\n\t\t\tcfg.Identity.PeerID,\n\t\t\tcfg.Addresses,\n\t\t\tcfg.Identity.PrivKey,\n\t\t\tcfg.HTTPRetrieval.Enabled.WithDefault(config.DefaultHTTPRetrievalEnabled),\n\t\t)\n\tdefault:\n\t\treturn fmt.Errorf(\"unrecognized routing option: %s\", routingOption)\n\t}\n\n\t// Resolve agent version suffix:\n\t// Version.AgentSuffix > --agent-version-suffix > implicit (build origin).\n\tversionSuffixFromCli, _ := req.Options[agentVersionSuffix].(string)\n\tversionSuffix := cfg.Version.AgentSuffix.WithDefault(versionSuffixFromCli)\n\tif versionSuffix == \"\" {","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/cmd/ipfs/kubo/daemon.go#L491-L527","documentation":"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.","triggerScenarios":"`ipfs daemon --routing=custom` (or Routing.Type=\"custom\") while config has Routing.AcceleratedDHTClient=true.","commonSituations":"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.","solutions":["Set Routing.AcceleratedDHTClient=false (or remove the key) in the config","Enable the accelerated client per-router: add \"AcceleratedDHTClient\": true in the Parameters of the DHT router under Routing.Routers","Alternatively change Routing.Type away from custom if you want the global option to apply"],"exampleFix":"// before\n\"Routing\": { \"Type\": \"custom\", \"AcceleratedDHTClient\": true, ... }\n// after\n\"Routing\": { \"Type\": \"custom\", \"Routers\": { \"dht\": { \"Type\": \"dht\", \"Parameters\": { \"AcceleratedDHTClient\": true } } }, ... }","handlingStrategy":"validation","validationCode":"cfg, _ := ipfsConfigShow()\nif cfg.Routing.Type == \"custom\" && cfg.Routing.AcceleratedDHTClient == true {\n    // move AcceleratedDHTClient into Routing.Routers.<name>.Parameters instead\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When switching Routing.Type to custom, remove global routing shortcuts","Set per-router Parameters for DHT tuning under Routing.Routers"],"tags":["ipfs","kubo","routing","dht","config"],"backgroundTag":"invalid-routing-config-combination","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"}