{"record":{"id":"3c49fd6720190914","repo":"ipfs/kubo","slug":"method-name-q-is-missing-from-routing-methods-con","errorCode":null,"errorMessage":"method name %q is missing from Routing.Methods config param","messagePattern":"method name %q is missing from Routing\\.Methods config param","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/routing.go","lineNumber":76,"sourceCode":"\t// Router type ID. See RouterType for more info.\n\tType RouterType\n\n\t// Parameters are extra configuration that this router might need.\n\t// A common one for HTTP router is \"Endpoint\".\n\tParameters any\n}\n\ntype (\n\tRouters map[string]RouterParser\n\tMethods map[MethodName]Method\n)\n\nfunc (m Methods) Check() error {\n\t// Check supported methods\n\tfor _, mn := range MethodNameList {\n\t\t_, ok := m[mn]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"method name %q is missing from Routing.Methods config param\", mn)\n\t\t}\n\t}\n\n\t// Check unsupported methods\n\tfor k := range m {\n\t\tseen := slices.Contains(MethodNameList, k)\n\n\t\tif seen {\n\t\t\tcontinue\n\t\t}\n\n\t\treturn fmt.Errorf(\"method name %q is not a supported method on Routing.Methods config param\", k)\n\t}\n\n\treturn nil\n}\n\ntype RouterParser struct {","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/config/routing.go#L58-L94","documentation":"Methods.Check in config/routing.go verifies that the Routing.Methods map contains an entry for every method name in MethodNameList. If any known method (e.g. provide, find-providers, get-ipns, put-ipns) is absent, this error is returned. The map is required to be exhaustive so routing behavior is always fully defined.","triggerScenarios":"Loading a config where Routing.Methods is present but missing one of the required method keys, e.g. setting only {\"provide\":\"custom\"} and omitting the others; Check is called by TestMethods and Parse during config parsing/validation.","commonSituations":"Partially migrating Routing.Type to a delegating router and hand-writing only the methods you think you need; older configs from a previous kubo version missing newly added method names after an upgrade.","solutions":["Add the missing method key named in the error to Routing.Methods with a valid router value (e.g. \"none\", \"dht\", \"delegated\", or a custom router name).","Run `ipfs config --json Routing.Methods '{...complete map...}'` with every entry from MethodNameList.","If unsure, delete Routing.Methods and use Routing.Type defaults instead."],"exampleFix":"// before (config.json)\n\"Routing\": { \"Methods\": { \"provide\": \"delegated\" } }\n// after\n\"Routing\": { \"Methods\": { \"provide\": \"delegated\", \"find-providers\": \"dht\", \"get-ipns\": \"dht\", \"put-ipns\": \"dht\" } }","handlingStrategy":"validation","validationCode":"m, err := config.ParseMethods(\"...\") // or build the map\nif err := methods.Check(); err != nil {\n    return fmt.Errorf(\"Routing.Methods incomplete: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := methods.Check(); err != nil { return fmt.Errorf(\"routing config invalid: %w\", err) }","preventionTips":["Always define every key listed in config.MethodNameList when setting Routing.Methods","After kubo upgrades, re-check Routing.Methods for newly required method names","Prefer Routing.Type over a hand-built Methods map when defaults suffice"],"tags":["config","routing","go","validation"],"backgroundTag":"missing-config-key","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"}