derailed/k9s · error

the server doesn't have a resource type '%s' in group '%s'

Error message

the server doesn't have a resource type '%s' in group '%s'

What it means

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.

Source

Thrown at internal/dao/rest_mapper.go:71

		err error
	)

	mapper, err := r.ToRESTMapper()
	if err != nil {
		return gvr, err
	}

	fullGVR, gr := schema.ParseResourceArg(strings.ToLower(resourceArg))
	if fullGVR != nil {
		return mapper.ResourceFor(*fullGVR)
	}

	gvr, err = mapper.ResourceFor(gr.WithVersion(""))
	if err != nil {
		if gr.Group == "" {
			return gvr, fmt.Errorf("the server doesn't have a resource type '%s'", gr.Resource)
		}
		return gvr, fmt.Errorf("the server doesn't have a resource type '%s' in group '%s'", gr.Resource, gr.Group)
	}

	return gvr, nil
}

func (*RestMapper) toRESTMapping(gvr schema.GroupVersionResource, kind string) *meta.RESTMapping {
	return &meta.RESTMapping{
		Resource: gvr,
		GroupVersionKind: schema.GroupVersionKind{
			Group:   gvr.Group,
			Version: gvr.Version,
			Kind:    kind,
		},
		Scope: RestMapping,
	}
}

// Name protocol returns rest scope name.

View on GitHub (pinned to 2d3ccc6ba2)

Solutions

  1. Enumerate the group's real resources: kubectl api-resources --api-group=<group>
  2. Update the group to the one the installed CRD/version actually serves
  3. Drop the group and use the bare resource name to search all groups, then pin the correct one

Example fix

# before
resource: networking.k8s.io/v1/ingressclasses # absent on old clusters

# after
resource: networking.k8s.io/ingresses
# check availability: kubectl api-resources --api-group=networking.k8s.io
Defensive patterns

Strategy: validation

Validate before calling

groupResources, err := f.Client().Discovery().ServerResourcesForGroupVersion(group + "/v1")
if err != nil { return fmt.Errorf("group %q not served here", group) }
// verify resourceArg appears in groupResources.APIResources

Try / catch

if _, err := mapper.ResourceFor(gvr); err != nil {
    if strings.Contains(err.Error(), "in group") {
        // enumerate kubectl api-resources --api-group=<g> and correct the pair
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of derailed/k9s@2d3ccc6ba2 (2026-08-15). Data as JSON: /api/errors/318cf6a348307c7c. Report an issue: GitHub.