derailed/k9s · warning

no data found for resource %s

Error message

no data found for resource %s

What it means

After hydrating rows and calling SetHeader, TableData checks HeaderCount(); zero header columns means the table has no column definitions to render, so the view cannot be displayed and the GVR is reported. The data fetch itself succeeded — only the header is missing.

Source

Thrown at internal/model1/table_data.go:275

			if !ok {
				return fmt.Errorf("expecting a meta table but got %T", oo[0])
			}
			rows = make(Rows, len(table.Rows))
			if err := GenericHydrate(t.namespace, table, rows, r); err != nil {
				return err
			}
		} else {
			rows = make(Rows, len(oo))
			if err := Hydrate(t.namespace, oo, rows, r); err != nil {
				return err
			}
		}
	}

	t.Update(rows)
	t.SetHeader(t.namespace, r.Header(t.namespace))
	if t.HeaderCount() == 0 {
		return fmt.Errorf("no data found for resource %s", t.gvr)
	}

	return nil
}

// Empty checks if there are no entries.
func (t *TableData) Empty() bool {
	t.mx.RLock()
	defer t.mx.RUnlock()

	return t.rowEvents.Empty()
}

func (t *TableData) SetRowEvents(re *RowEvents) {
	t.rowEvents = re
}

func (t *TableData) GetRowEvents() *RowEvents {

View on GitHub (pinned to 2d3ccc6ba2)

Solutions

  1. Check for custom view/skin overrides on that resource and remove/fix the columns block (verify field names with kubectl get <crd> -o yaml)
  2. For CRDs, define additionalPrinterColumns in the CRD spec so the server emits columns
  3. Confirm kubectl get <resource> shows headers in a terminal (server-side table works)
  4. Restart/reload k9s config after fixing: the views/skin are read at launch

Example fix

# before: views.yaml with wrong field name
views:
  v1/pods:
    columns:
      - NAME: AGE
        width: 10
# after: correct field
views:
  v1/pods:
    columns:
      - AGE: AGE
        width: 10
Defensive patterns

Strategy: validation

Validate before calling

// Before mounting the view, confirm the server exposes columns.
cols := resourceColumnNames(gvr) // via discovery/CRD additionalPrinterColumns
if len(cols) == 0 && !hasCustomView(gvr) {
    return fmt.Errorf("resource %s has no printer columns; define a custom view or CRD additionalPrinterColumns", gvr)
}

Try / catch

if err := td.reconcile(ctx, ns); err != nil && strings.Contains(err.Error(), "no data found for resource") {
    // empty-but-valid view beats a hard error; surface a soft 'no columns configured' notice
    return showNoColumnsNotice(td.gvr)
}

Prevention

When it happens

Trigger: Loading a resource view where the renderer produces no columns: custom view/skin configs whose columns don't match the resource's fields, CRDs without additionalPrinterColumns on a server that returns a bare table, or a namespace where the table came back with only hidden/namespaced-augmented columns.

Common situations: Custom k9s views.yaml or skin column overrides with wrong JSONPath/field names (typo'd field silently drops the column); freshly installed operators whose CRD lacks printer columns; AGgregated APIs returning tables without column definitions.

Related errors


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