{"record":{"id":"d43e052dd9e906c2","repo":"derailed/k9s","slug":"no-table-found-for-gvr-s","errorCode":null,"errorMessage":"no table found for gvr: %s","messagePattern":"no table found for gvr: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/dao/workload.go","lineNumber":85,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\tdial := d.Resource(gvr.GVR())\n\tif client.IsClusterScoped(ns) {\n\t\treturn dial.Delete(ctx, n, opts)\n\t}\n\n\treturn dial.Namespace(ns).Delete(ctx, n, opts)\n}\n\nfunc (a *Workload) fetch(ctx context.Context, gvr *client.GVR, ns string) (*metav1.Table, error) {\n\ta.gvr = gvr\n\too, err := a.Table.List(ctx, ns)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(oo) == 0 {\n\t\treturn nil, fmt.Errorf(\"no table found for gvr: %s\", gvr)\n\t}\n\ttt, ok := oo[0].(*metav1.Table)\n\tif !ok {\n\t\treturn nil, errors.New(\"not a metav1.Table\")\n\t}\n\n\treturn tt, nil\n}\n\n// List fetch workloads.\nfunc (a *Workload) List(ctx context.Context, ns string) ([]runtime.Object, error) {\n\too := make([]runtime.Object, 0, 100)\n\tfor _, gvr := range resList {\n\t\ttable, err := a.fetch(ctx, gvr, ns)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvar (","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/dao/workload.go#L67-L103","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Confirm instances exist: kubectl get <resource> -n <ns>","Verify the GVR spelling/group via kubectl api-resources | grep <name>","If the namespace is legitimately empty, treat this as a no-data case in the caller instead of an error path","For aggregated APIs lacking table support, file/fix the extension server to implement table conversion"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the GVR resolves and has instances before fetching the table.\ngvr, err := factory.CanForResource(ctx, wantedGVR, client.ListAccess)\nif err != nil { return err }\nif oo, err := lister.List(ctx, ns); err == nil && len(oo) == 0 {\n    return ErrNoData // treat empty as a valid state, not a table error\n}","typeGuard":null,"tryCatchPattern":"tbl, err := w.fetch(ctx, gvr, ns)\nif err != nil {\n    if strings.Contains(err.Error(), \"no table found for gvr\") {\n        return nil, fmt.Errorf(\"%w — confirm with: kubectl api-resources | grep %s\", err, gvr)\n    }\n    return nil, err\n}","preventionTips":["Resolve GVRs through discovery instead of hand-built strings","Handle empty-namespace results upstream so empty never reaches the table parser"],"tags":["kubernetes","table","gvr","list","k9s"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}