{"record":{"id":"c411ce8fb7d2aceb","repo":"ipfs/kubo","slug":"method-name-q-is-not-a-supported-method-on-routin","errorCode":null,"errorMessage":"method name %q is not a supported method on Routing.Methods config param","messagePattern":"method name %q is not a supported method on Routing\\.Methods config param","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/routing.go","lineNumber":88,"sourceCode":"\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 {\n\tRouter\n}\n\nfunc (r *RouterParser) UnmarshalJSON(b []byte) error {\n\tout := Router{}\n\tout.Parameters = &json.RawMessage{}\n\tif err := json.Unmarshal(b, &out); err != nil {\n\t\treturn err\n\t}\n\traw := out.Parameters.(*json.RawMessage)\n\n\tvar p any","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/config/routing.go#L70-L106","documentation":"Methods.Check also rejects unknown keys: any method name in Routing.Methods that is not present in MethodNameList produces this error. Only a fixed, versioned set of routing method names is supported, preventing typos or stale names from silently being ignored.","triggerScenarios":"Including a key in Routing.Methods that is not in MethodNameList, e.g. a misspelled \"findprovider\" or a method name removed in a newer kubo version; Check runs during Parse/TestMethods of the routing config.","commonSituations":"Typos when hand-editing config.json, copying method names from blog posts about older kubo versions, or renaming methods after a kubo upgrade so old keys become unsupported.","solutions":["Remove or rename the offending key in Routing.Methods so it matches a supported name from MethodNameList exactly.","Check the exact supported names for your kubo version (docs/config.md, Routing.Methods section).","Regenerate the config section with `ipfs config --json Routing.Methods '...'` instead of manual JSON editing to catch typos."],"exampleFix":"// before (config.json)\n\"Routing\": { \"Methods\": { \"findprovider\": \"dht\" } }\n// after\n\"Routing\": { \"Methods\": { \"find-providers\": \"dht\" } }","handlingStrategy":"validation","validationCode":"for k := range methods {\n    if !slices.Contains(config.MethodNameList, k) {\n        return fmt.Errorf(\"unsupported Routing.Methods key: %q\", k)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := methods.Check(); err != nil { return fmt.Errorf(\"routing config invalid: %w\", err) }","preventionTips":["Copy method names exactly from docs/config.md for your kubo version","Use `ipfs config --json Routing.Methods '...'` to avoid JSON typos","Diff Routing.Methods keys against MethodNameList after upgrades"],"tags":["config","routing","go","validation"],"backgroundTag":"invalid-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"}