derailed/k9s · warning
nothing selected %q
Error message
nothing selected %q
What it means
editRes was invoked with an empty selection path, meaning the edit command (`e`) ran while no row was selected in the browser. The path identifies the resource to edit (namespace/name); empty means there is nothing to send to kubectl edit.
Source
Thrown at internal/view/browser.go:557
func (b *Browser) editCmd(evt *tcell.EventKey) *tcell.EventKey {
path := b.GetSelectedItem()
if path == "" {
return evt
}
b.Stop()
defer b.Start()
if err := editRes(b.app, b.GVR(), path); err != nil {
b.App().Flash().Err(err)
}
return nil
}
func editRes(app *App, gvr *client.GVR, path string) error {
if path == "" {
return fmt.Errorf("nothing selected %q", path)
}
ns, n := client.Namespaced(path)
if n == "" {
return fmt.Errorf("missing resource name in path %q", path)
}
if client.IsClusterScoped(ns) {
ns = client.BlankNamespace
}
if ok, err := app.Conn().CanI(ns, gvr, n, client.PatchAccess); !ok || err != nil {
return fmt.Errorf("current user can't edit resource %s", gvr)
}
args := make([]string, 0, 10)
args = append(args, "edit", gvr.FQN(n))
if ns != client.BlankNamespace {
args = append(args, "-n", ns)
}
if err := runK(app, &shellOpts{clear: true, args: args}); err != nil {View on GitHub (pinned to 2d3ccc6ba2)
Solutions
- Select a row first (arrow keys/mouse) before pressing `e`; verify the list actually has entries.
- If automating, check b.GVR()/GetSelectedPath() returns non-empty before invoking edit.
- If the list is unexpectedly empty, clear filters ( / filter text, Escape) so rows render.
Defensive patterns
Strategy: validation
Validate before calling
path := b.GetTable().GetSelectedPath()
if path == "" {
b.App().Flash().Err(fmt.Errorf("select a row before editing"))
return nil
}
return editRes(b.app, b.GVR(), path) Try / catch
if err := editRes(app, gvr, path); err != nil {
if strings.Contains(err.Error(), "nothing selected") {
app.Flash().Err(err) // user guidance, no retry needed
}
} Prevention
- Guard every row-scoped command (edit/delete/describe) on a non-empty selection path.
- Disable or no-op row keybindings when the table has zero rows.
- In automation, assert GetSelectedPath() is non-empty before invoking edit commands.
When it happens
Trigger: Pressing `e` in a browser view with zero rows, with the cursor on a header/blank line, or when the selected row's path failed to resolve (GetSelectedPath returned empty). Also occurs programmatically calling editRes(app, gvr, "").
Common situations: Empty or filtered-to-zero resource list; keybinding race where `e` fires before the table loads; headless/automated use that calls the edit command without a selection.
Related errors
- missing resource name in path %q
- expecting cronjob resource
- expecting Deployment resource
- expecting ServiceAccount resource
- expecting a context factory
AI-assisted analysis of derailed/k9s@2d3ccc6ba2 (2026-08-15).
Data as JSON: /api/errors/d6a142d696c01725.
Report an issue: GitHub.