derailed/k9s · error

no column index for %s

Error message

no column index for %s

What it means

The ScaleExtender resolves values from the browser table by column header name via HeaderIndex(col) (internal/view/scale_extender.go:92). If the table's header row does not contain the requested column (e.g. 'READY'), the lookup returns false and this error names the missing column.

Source

Thrown at internal/view/scale_extender.go:92

		return
	}
	confirm := tview.NewModalForm("<Scale>", form)
	msg := fmt.Sprintf("Scale %s %s?", singularize(s.GVR().R()), paths[0])
	if len(paths) > 1 {
		msg = fmt.Sprintf("Scale [%d] %s?", len(paths), s.GVR().R())
	}
	confirm.SetText(msg)
	confirm.SetDoneFunc(func(int, string) {
		s.dismissDialog()
	})
	s.App().Content.AddPage(scaleDialogKey, confirm, false, false)
	s.App().Content.ShowPage(scaleDialogKey)
}

func (s *ScaleExtender) valueOf(col string) (string, error) {
	colIdx, ok := s.GetTable().HeaderIndex(col)
	if !ok {
		return "", fmt.Errorf("no column index for %s", col)
	}
	return s.GetTable().GetSelectedCell(colIdx), nil
}

func (s *ScaleExtender) replicasFromReady(_ string) (string, error) {
	replicas, err := s.valueOf("READY")
	if err != nil {
		return "", err
	}

	tokens := strings.Split(replicas, "/")
	if len(tokens) < 2 {
		return "", fmt.Errorf("unable to locate replicas from %s", replicas)
	}

	return strings.TrimRight(tokens[1], ui.DeltaSign), nil
}

View on GitHub (pinned to 2d3ccc6ba2)

Solutions

  1. Check ~/.config/k9s/views.yaml for the resource and restore the READY column (remove the columns override to get defaults)
  2. Confirm you are scaling a scalable workload (deploy/rs/sts) which ships a READY column by default
  3. If you control the renderer, ensure the header includes 'READY'
  4. Scale via kubectl as a fallback: 'kubectl scale deploy <name> --replicas=N'

Example fix

# before: ~/.config/k9s/views.yml drops READY
views:
  v1/deployments:
    columns:
      - NAME:.metadata.name
# -> no column index for READY

# after: include READY or delete the override
views:
  v1/deployments:
    columns:
      - NAME:.metadata.name
      - READY:.status.readyReplicas
Defensive patterns

Strategy: validation

Validate before calling

// verify the column exists before reading it
if _, ok := s.GetTable().HeaderIndex("READY"); !ok {
    return "", fmt.Errorf("view lacks READY column; check views.yml override for %s", s.GVR())
}

Prevention

When it happens

Trigger: Pressing the scale keybinding on a resource whose table view lacks a READY column — most often because a custom views.yaml column override for that GVR dropped or renamed READY, or the extender was attached to a GVR whose renderer never emits that header.

Common situations: Customizing k9s views.yaml columns for deployments/statefulsets/replicasets and omitting READY; a plugin or fork attaching ScaleExtender to a CRD view with different headers; header case/label drift after a k9s upgrade changed column names.

Related errors


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