derailed/k9s · error

no table found for gvr: %s

Error message

no table found for gvr: %s

What it means

Workload.fetch asks the DAO's Table lister for objects and expects at least one item that is a *metav1.Table. The error fires when the list returns zero objects for the GVR, so there is no table to extract column definitions from.

Source

Thrown at internal/dao/workload.go:85

	if err != nil {
		return err
	}
	dial := d.Resource(gvr.GVR())
	if client.IsClusterScoped(ns) {
		return dial.Delete(ctx, n, opts)
	}

	return dial.Namespace(ns).Delete(ctx, n, opts)
}

func (a *Workload) fetch(ctx context.Context, gvr *client.GVR, ns string) (*metav1.Table, error) {
	a.gvr = gvr
	oo, err := a.Table.List(ctx, ns)
	if err != nil {
		return nil, err
	}
	if len(oo) == 0 {
		return nil, fmt.Errorf("no table found for gvr: %s", gvr)
	}
	tt, ok := oo[0].(*metav1.Table)
	if !ok {
		return nil, errors.New("not a metav1.Table")
	}

	return tt, nil
}

// List fetch workloads.
func (a *Workload) List(ctx context.Context, ns string) ([]runtime.Object, error) {
	oo := make([]runtime.Object, 0, 100)
	for _, gvr := range resList {
		table, err := a.fetch(ctx, gvr, ns)
		if err != nil {
			return nil, err
		}
		var (

View on GitHub (pinned to 2d3ccc6ba2)

Solutions

  1. Confirm instances exist: kubectl get <resource> -n <ns>
  2. Verify the GVR spelling/group via kubectl api-resources | grep <name>
  3. If the namespace is legitimately empty, treat this as a no-data case in the caller instead of an error path
  4. For aggregated APIs lacking table support, file/fix the extension server to implement table conversion
Defensive patterns

Strategy: validation

Validate before calling

// Verify the GVR resolves and has instances before fetching the table.
gvr, err := factory.CanForResource(ctx, wantedGVR, client.ListAccess)
if err != nil { return err }
if oo, err := lister.List(ctx, ns); err == nil && len(oo) == 0 {
    return ErrNoData // treat empty as a valid state, not a table error
}

Try / catch

tbl, err := w.fetch(ctx, gvr, ns)
if err != nil {
    if strings.Contains(err.Error(), "no table found for gvr") {
        return nil, fmt.Errorf("%w — confirm with: kubectl api-resources | grep %s", err, gvr)
    }
    return nil, err
}

Prevention

When it happens

Trigger: Calling Workload.fetch/ListDetail on a GVR that returns an empty list: namespace has no instances and the server omits the table object, the GVR string is wrong (typo, missing group), or the resource kind has no server-side table converter registered.

Common situations: Empty namespaces for custom resources; mistyped resource in a custom view or alias; aggregated API services that don't implement the Table accept header conversion.

Related errors


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