{"record":{"id":"44699cfd0e1af5c2","repo":"derailed/k9s","slug":"the-server-doesn-t-have-a-resource-type-s","errorCode":null,"errorMessage":"the server doesn't have a resource type '%s'","messagePattern":"the server doesn't have a resource type '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/dao/rest_mapper.go","lineNumber":69,"sourceCode":"\tvar (\n\t\tgvr schema.GroupVersionResource\n\t\terr error\n\t)\n\n\tmapper, err := r.ToRESTMapper()\n\tif err != nil {\n\t\treturn gvr, err\n\t}\n\n\tfullGVR, gr := schema.ParseResourceArg(strings.ToLower(resourceArg))\n\tif fullGVR != nil {\n\t\treturn mapper.ResourceFor(*fullGVR)\n\t}\n\n\tgvr, err = mapper.ResourceFor(gr.WithVersion(\"\"))\n\tif err != nil {\n\t\tif gr.Group == \"\" {\n\t\t\treturn gvr, fmt.Errorf(\"the server doesn't have a resource type '%s'\", gr.Resource)\n\t\t}\n\t\treturn gvr, fmt.Errorf(\"the server doesn't have a resource type '%s' in group '%s'\", gr.Resource, gr.Group)\n\t}\n\n\treturn gvr, nil\n}\n\nfunc (*RestMapper) toRESTMapping(gvr schema.GroupVersionResource, kind string) *meta.RESTMapping {\n\treturn &meta.RESTMapping{\n\t\tResource: gvr,\n\t\tGroupVersionKind: schema.GroupVersionKind{\n\t\t\tGroup:   gvr.Group,\n\t\t\tVersion: gvr.Version,\n\t\t\tKind:    kind,\n\t\t},\n\t\tScope: RestMapping,\n\t}\n}","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/dao/rest_mapper.go#L51-L87","documentation":"RestMapper.ResourceFor resolves a user-supplied resource argument through the discovery-backed mapper. When the argument carries no group and resolution fails, the underlying meta.NoResourceMatchError is rewritten into this kubectl-style message naming the bare resource.","triggerScenarios":"Resolving a group-less GVR string such as \"pds\" or \"ingres\" when the cluster exposes no resource with that name — typos, absent CRDs, wrong pluralization.","commonSituations":"Typos in resource names on the command line or in config; CRDs not yet installed on the target cluster (cert-manager, gateway-api, operators); kubeconfig pointing at a cluster that lacks the aggregated API.","solutions":["List what the cluster actually serves: kubectl api-resources and fix the spelling","Install the CRD/operator that provides the resource, then retry","Prefer group-qualified names (apps/deployments) so failures point at the exact group (see the sibling group error)"],"exampleFix":"# before\nresource: deploymentss\n\n# after\nresource: deployments\n# verify with: kubectl api-resources | grep deploy","handlingStrategy":"validation","validationCode":"names, err := f.Client().Discovery().ServerResourceNames() // or cached mapper\nif err != nil { return err }\nif !containsResource(names, resourceArg) {\n    return fmt.Errorf(\"resource %q not served by this cluster\", resourceArg)\n}","typeGuard":null,"tryCatchPattern":"if _, err := mapper.ResourceFor(gvr); err != nil {\n    if strings.Contains(err.Error(), \"doesn't have a resource type\") {\n        // suggest closest match from kubectl api-resources instead of retrying\n    }\n}","preventionTips":["Resolve resource names against live discovery at startup and fail with suggestions","Pin configs to group-qualified resource names rather than bare plurals","After installing CRDs, refresh discovery caches before resolving new types"],"tags":["kubernetes","resource-discovery","crd","typo"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}