{"record":{"id":"29eacb0aae5a6fc1","repo":"ipfs/kubo","slug":"s-not-found","errorCode":null,"errorMessage":"%s not found","messagePattern":"(.+?) not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":257,"sourceCode":"\tparts := strings.Split(key, \".\")\n\tfor i, part := range parts {\n\t\tmapCursor, ok = cursor.(map[string]any)\n\t\tif !ok {\n\t\t\tif cursor == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tpath := strings.Join(parts[:i], \".\")\n\t\t\treturn fmt.Errorf(\"%s key is not a map\", path)\n\t\t}\n\n\t\tcursor, ok = mapCursor[part]\n\t\tif !ok {\n\t\t\t// If the config sections is a map, validate against the default entry.\n\t\t\tif cursor, ok = mapCursor[\"*\"]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpath := strings.Join(parts[:i+1], \".\")\n\t\t\treturn fmt.Errorf(\"%s not found\", path)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":239,"sourceCodeEnd":262,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/config/config.go#L239-L262","documentation":"CheckKey() validates a dotted key against the config structure; if a segment is not found in the current map (and no \"*\" wildcard default section matches), the key does not exist in the schema. The error reports the full path up to and including the missing segment.","triggerScenarios":"Calling CheckKey or SetConfigKey with a key segment that does not exist in the config schema, e.g. \"Adresses.API\" (typo) or \"Foo.Bar\" for a nonexistent section, with no wildcard (\"*\") section covering it.","commonSituations":"Typos in CLI `ipfs config` key arguments; using config keys from an older/newer kubo version that were renamed or removed; scripts referencing plugin-provided sections when the plugin is not loaded.","solutions":["Check spelling of every segment in the dotted key","Run `ipfs config show` or consult docs/config.md for the valid key names","Verify the relevant plugin providing the config section is loaded","Confirm the key exists in the kubo version in use (schema changes across releases)"],"exampleFix":"// before\nerr := CheckKey(cfg, \"Pubsub.Enbled\") // typo\n// after\nerr := CheckKey(cfg, \"Pubsub.Enabled\")","handlingStrategy":"validation","validationCode":"if err := config.CheckKey(cfg, \"Pubsub.Enabled\"); err != nil {\n\t// key rejected: check docs/config.md for the valid name before setting\n\tlog.Fatalf(\"invalid config key: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := SetConfigKey(cfg, key, val); err != nil {\n\tif strings.HasSuffix(err.Error(), \"not found\") {\n\t\treturn fmt.Errorf(\"unknown config key %q (check docs/config.md and kubo version): %w\", key, err)\n\t}\n\treturn err\n}","preventionTips":["Cross-check every key against docs/config.md for the kubo version in use","Watch for renames across upgrades and migrate config keys on version bumps","Spell-check dotted paths; most rejections are typos","Verify plugin-provided sections exist (plugin loaded) before referencing them"],"tags":["config","validation","path"],"backgroundTag":"config-key-not-found","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"}