{"record":{"id":"769059c2ea68cb09","repo":"derailed/k9s","slug":"nothing-selected","errorCode":null,"errorMessage":"nothing selected","messagePattern":"nothing selected","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/view/container.go","lineNumber":108,"sourceCode":"\taa.Bulk(ui.KeyMap{\n\t\tui.KeyF:      ui.NewKeyAction(\"Show PortForward\", c.showPFCmd, true),\n\t\tui.KeyShiftF: ui.NewKeyAction(\"PortForward\", c.portFwdCmd, true),\n\t})\n}\n\nfunc (c *Container) k9sEnv() Env {\n\tpath := c.GetTable().GetSelectedItem()\n\trow := c.GetTable().GetSelectedRow(path)\n\tenv := defaultEnv(c.App().Conn().Config(), path, c.GetTable().GetModel().Peek().Header(), row)\n\tenv[\"NAMESPACE\"], env[\"POD\"] = client.Namespaced(c.GetTable().Path)\n\n\treturn env\n}\n\nfunc (c *Container) logOptions(prev bool) (*dao.LogOptions, error) {\n\tpath := c.GetTable().GetSelectedItem()\n\tif path == \"\" {\n\t\treturn nil, errors.New(\"nothing selected\")\n\t}\n\n\tcfg := c.App().Config.K9s.Logger\n\topts := dao.LogOptions{\n\t\tPath:            c.GetTable().Path,\n\t\tContainer:       path,\n\t\tLines:           cfg.TailCount,\n\t\tSinceSeconds:    cfg.SinceSeconds,\n\t\tSingleContainer: true,\n\t\tShowTimestamp:   cfg.ShowTime,\n\t\tPrevious:        prev,\n\t}\n\n\treturn &opts, nil\n}\n\nfunc (c *Container) viewLogs(*App, ui.Tabular, *client.GVR, string) {\n\tc.ResourceViewer.(*LogsExtender).showLogs(c.GetTable().Path, false)","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/view/container.go#L90-L126","documentation":"Returned by `Container.logOptions` (internal/view/container.go:~108) when the container table has no selected row (`GetTable().GetSelectedItem()` returns \"\"). The logs command (`l` / `p` for previous) needs a container path to build `dao.LogOptions`; with an empty selection it fails fast instead of fetching logs for nothing.","triggerScenarios":"Pressing the logs key (or shift-l for previous logs) on the container view while no row is selected — e.g. empty container list, filter that removed all rows, or focus lost before the keypress.","commonSituations":"Pod has a single init container that finished and the list is empty; a filter (`/`) excluded every row; user hits `l` immediately after entering the view before selection settles.","solutions":["Make sure the container list is non-empty and a row is highlighted before pressing `l`","Clear any active filter that hides all rows (`/` then Esc)","If the container list is empty, the pod has no reportable containers — inspect it with `kubectl describe pod`","Use `p` only after selecting a container when you want previous (crashed) instance logs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if c.GetTable().GetSelectedItem() == \"\" {\n    c.App().Flash().Warnf(\"Select a container first\")\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bind log keys to check selection first and flash a hint","Clear filters that empty the table","Confirm the pod has containers before entering the view"],"tags":["ui","selection","logs","container","k9s"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}