abiosoft/colima · warning

%s is not enabled

Error message

%s is not enabled

What it means

`colima kubernetes stop` loads the Kubernetes subsystem and checks k.Running(ctx) inside the VM before stopping. When the cluster is not running (never started, already stopped, or the VM restarted without the cluster), it refuses with '%s is not enabled' (kubernetes.Name). It is a state guard, not a failure of the stop operation itself.

Source

Thrown at cmd/kubernetes.go:68

		return k.Start(context.Background())
	},
}

// kubernetesStopCmd represents the kubernetes stop command
var kubernetesStopCmd = &cobra.Command{
	Use:   "stop",
	Short: "stop the Kubernetes cluster",
	Long:  `Stop the Kubernetes cluster.`,
	Args:  cobra.NoArgs,
	RunE: func(cmd *cobra.Command, args []string) error {
		ctx := cmd.Context()
		app := newApp()
		k, err := app.Kubernetes()
		if err != nil {
			return err
		}
		if !k.Running(ctx) {
			return fmt.Errorf("%s is not enabled", kubernetes.Name)
		}

		return k.Stop(ctx, false)
	},
}

// kubernetesDeleteCmd represents the kubernetes delete command
var kubernetesDeleteCmd = &cobra.Command{
	Use:   "delete",
	Short: "delete the Kubernetes cluster",
	Long:  `Delete the Kubernetes cluster.`,
	Args:  cobra.NoArgs,
	RunE: func(cmd *cobra.Command, args []string) error {
		ctx := cmd.Context()
		app := newApp()
		k, err := app.Kubernetes()
		if err != nil {
			return err

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Nothing to do if the goal was 'make sure it is stopped' — the cluster is already down
  2. To actually manage it: `colima start --kubernetes`, verify with `colima kubernetes status`, then stop
  3. In scripts, treat this specific message as success — the command exited non-zero but the desired state is already reached

Example fix

# before
colima kubernetes stop || exit 1

# after
if ! colima kubernetes status >/dev/null 2>&1; then
    echo "kubernetes not running; nothing to stop"
else
    colima kubernetes stop
fi
Defensive patterns

Strategy: validation

Validate before calling

# treat 'not enabled' as already-stopped (idempotent stop)
if ! colima kubernetes status >/dev/null 2>&1; then
    echo "kubernetes not running; nothing to stop"
else
    colima kubernetes stop
fi

Try / catch

if err := stopCmd.Execute(); err != nil {
    if strings.Contains(err.Error(), "is not enabled") {
        err = nil // desired state already reached
    }
}

Prevention

When it happens

Trigger: Running `colima kubernetes stop` when the cluster was never started (`colima start` without --kubernetes); when it was already stopped; when the VM was recreated via `colima delete` + `colima start` without kubernetes; or when k3s inside the guest is still initializing so Running() reports false.

Common situations: Idempotent cleanup scripts calling stop unconditionally on a fresh machine; double-running the stop command; cluster disabled in the current profile's config.

Related errors


AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15). Data as JSON: /api/errors/799e9536041b4e09. Report an issue: GitHub.