{"record":{"id":"318cf6a348307c7c","repo":"derailed/k9s","slug":"the-server-doesn-t-have-a-resource-type-s-in-gr","errorCode":null,"errorMessage":"the server doesn't have a resource type '%s' in group '%s'","messagePattern":"the server doesn't have a resource type '(.+?)' in group '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/dao/rest_mapper.go","lineNumber":71,"sourceCode":"\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}\n\n// Name protocol returns rest scope name.","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/dao/rest_mapper.go#L53-L89","documentation":"The group-qualified variant of the rest-mapper failure: the resource argument included an explicit group (e.g. apps/deployments) and mapper.ResourceFor failed, so the message names both resource and group. This distinguishes a wrong resource name inside a valid group from a group the cluster does not serve at all.","triggerScenarios":"Resolving strings like \"apps/deploymentss\", or groups that were renamed/removed between API versions (CRDs that moved between beta and GA groups), against a cluster that does not serve that combination.","commonSituations":"Gateway API beta (gateway.networking.k8s.io) vs GA group churn; CRDs that changed groups across operator major versions; copy-pasted group/resource pairs from docs for a different cluster version.","solutions":["Enumerate the group's real resources: kubectl api-resources --api-group=<group>","Update the group to the one the installed CRD/version actually serves","Drop the group and use the bare resource name to search all groups, then pin the correct one"],"exampleFix":"# before\nresource: networking.k8s.io/v1/ingressclasses # absent on old clusters\n\n# after\nresource: networking.k8s.io/ingresses\n# check availability: kubectl api-resources --api-group=networking.k8s.io","handlingStrategy":"validation","validationCode":"groupResources, err := f.Client().Discovery().ServerResourcesForGroupVersion(group + \"/v1\")\nif err != nil { return fmt.Errorf(\"group %q not served here\", group) }\n// verify resourceArg appears in groupResources.APIResources","typeGuard":null,"tryCatchPattern":"if _, err := mapper.ResourceFor(gvr); err != nil {\n    if strings.Contains(err.Error(), \"in group\") {\n        // enumerate kubectl api-resources --api-group=<g> and correct the pair\n    }\n}","preventionTips":["Version CRD-dependent configs with the group the installed operator serves","When CRDs change groups across releases, update references in the same upgrade","Verify pairs with kubectl api-resources --api-group before deploying configs"],"tags":["kubernetes","resource-discovery","crd","api-group"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}