{"record":{"id":"8aa58ebbf2830782","repo":"derailed/k9s","slug":"you-must-provide-a-selection-8aa58e","errorCode":null,"errorMessage":"you must provide a selection","messagePattern":"you must provide a selection","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/view/pod.go","lineNumber":139,"sourceCode":"\t\t\t\tDangerous: true,\n\t\t\t}),\n\t})\n}\n\nfunc (p *Pod) bindKeys(aa *ui.KeyActions) {\n\tif !p.App().Config.IsReadOnly() {\n\t\tp.bindDangerousKeys(aa)\n\t}\n\n\taa.Bulk(ui.KeyMap{\n\t\tui.KeyO: ui.NewKeyAction(\"Show Node\", p.showNode, true),\n\t})\n}\n\nfunc (p *Pod) logOptions(prev bool) (*dao.LogOptions, error) {\n\tpath := p.GetTable().GetSelectedItem()\n\tif path == \"\" {\n\t\treturn nil, errors.New(\"you must provide a selection\")\n\t}\n\n\tpod, err := fetchPod(p.App().factory, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn podLogOptions(p.App(), path, prev, &pod.ObjectMeta, &pod.Spec), nil\n}\n\nfunc (p *Pod) showContainers(app *App, _ ui.Tabular, _ *client.GVR, _ string) {\n\tco := NewContainer(client.CoGVR)\n\tco.SetContextFn(p.coContext)\n\tif err := app.inject(co, false); err != nil {\n\t\tapp.Flash().Err(err)\n\t}\n}\n","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/view/pod.go#L121-L157","documentation":"Returned by `Pod.logOptions` (internal/view/pod.go:~139) when the pods table has no selected item. k9s needs the pod path to `fetchPod` and build `dao.LogOptions`; an empty selection short-circuits with this error.","triggerScenarios":"Pressing the logs key (`l` or shift-`p`) on the pod view while GetSelectedItem() returns \"\" — empty pod list, filter hiding all rows, or selection not yet established.","commonSituations":"Namespace with zero pods; label/field filter excludes everything; pressing the key right after entering the view or during a table refresh.","solutions":["Select (highlight) a pod row first, then press `l`","Clear any active filter (`/` then Esc)","Confirm pods exist: `kubectl get pods -n <ns>`","If the list is empty due to RBAC, verify list permissions for pods in that namespace"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if p.GetTable().GetSelectedItem() == \"\" {\n    p.App().Flash().Warnf(\"You must select a pod\")\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Highlight a pod before pressing l/p","Verify pods exist and RBAC allows listing","Clear filters"],"tags":["ui","selection","logs","pod","k9s"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}