{"record":{"id":"f0730dbf93d0fb5e","repo":"derailed/k9s","slug":"plugin-q-validation-failed-for-s-w","errorCode":null,"errorMessage":"plugin %q validation failed for %s: %w","messagePattern":"plugin %q validation failed for (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/plugin.go","lineNumber":188,"sourceCode":"\tswitch scheme {\n\tcase json.PluginSchema:\n\t\tvar o Plugin\n\t\tif err := yaml.Unmarshal(bb, &o); err != nil {\n\t\t\treturn fmt.Errorf(\"plugin unmarshal failed for %s: %w\", path, err)\n\t\t}\n\t\tif err := o.Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"plugin validation failed for %s: %w\", path, err)\n\t\t}\n\t\tp.Plugins[strings.TrimSuffix(filepath.Base(path), filepath.Ext(path))] = o\n\tcase json.PluginsSchema:\n\t\tvar oo Plugins\n\t\tif err := yaml.Unmarshal(bb, &oo); err != nil {\n\t\t\treturn fmt.Errorf(\"plugin unmarshal failed for %s: %w\", path, err)\n\t\t}\n\t\tfor k := range oo.Plugins {\n\t\t\tplug := oo.Plugins[k]\n\t\t\tif err := plug.Validate(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"plugin %q validation failed for %s: %w\", k, path, err)\n\t\t\t}\n\t\t\tp.Plugins[k] = plug\n\t\t}\n\tcase json.PluginMultiSchema:\n\t\tvar oo plugins\n\t\tif err := yaml.Unmarshal(bb, &oo); err != nil {\n\t\t\treturn fmt.Errorf(\"plugin unmarshal failed for %s: %w\", path, err)\n\t\t}\n\t\tfor k := range oo {\n\t\t\tplug := oo[k]\n\t\t\tif err := plug.Validate(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"plugin %q validation failed for %s: %w\", k, path, err)\n\t\t\t}\n\t\t\tp.Plugins[k] = plug\n\t\t}\n\t}\n\n\treturn nil","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/config/plugin.go#L170-L206","documentation":"For the plugins-map shape, k9s validates each plugin in the map with Plugin.Validate() (internal/config/plugin.go:185-190). This error names the specific plugin key %q and the file path, wrapping the semantic failure.","triggerScenarios":"Any Plugin.Validate failure (duplicate input name, bad dropdown/bool/number default - see errors 100/103) inside one entry of a `plugins:` map. The %q in the message identifies which map key is at fault, which error 103 does not provide.","commonSituations":"Large multi-plugin files where one entry has a bad default; entries copied from different sources with inconsistent input definitions.","solutions":["Read the message: the first verb (%q) is the plugin key, the %w tail is the exact rule broken","Fix that one entry's inputs (unique names, defaults matching type rules)","Re-run k9s; remaining bad entries will surface one at a time since load fails fast per file"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate every map entry and report all failures at once, unlike k9s's fail-fast load.\nfunc LintAllEntries(path string) []error {\n\tb, _ := os.ReadFile(path)\n\tvar ps config.Plugins\n\t_ = yaml.Unmarshal(b, &ps)\n\tvar errs []error\n\tfor k, p := range ps.Plugins {\n\t\tif err := p.Validate(); err != nil { errs = append(errs, fmt.Errorf(\"%q: %w\", k, err)) }\n\t}\n\treturn errs\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bulk-validate entries in CI so one bad default does not take down the whole load","Namespace input names per plugin to avoid collisions"],"tags":["go","yaml","k9s","plugin","config","validation"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}