{"record":{"id":"799e9536041b4e09","repo":"abiosoft/colima","slug":"s-is-not-enabled","errorCode":null,"errorMessage":"%s is not enabled","messagePattern":"(.+?) is not enabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/kubernetes.go","lineNumber":68,"sourceCode":"\t\treturn k.Start(context.Background())\n\t},\n}\n\n// kubernetesStopCmd represents the kubernetes stop command\nvar kubernetesStopCmd = &cobra.Command{\n\tUse:   \"stop\",\n\tShort: \"stop the Kubernetes cluster\",\n\tLong:  `Stop the Kubernetes cluster.`,\n\tArgs:  cobra.NoArgs,\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tctx := cmd.Context()\n\t\tapp := newApp()\n\t\tk, err := app.Kubernetes()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !k.Running(ctx) {\n\t\t\treturn fmt.Errorf(\"%s is not enabled\", kubernetes.Name)\n\t\t}\n\n\t\treturn k.Stop(ctx, false)\n\t},\n}\n\n// kubernetesDeleteCmd represents the kubernetes delete command\nvar kubernetesDeleteCmd = &cobra.Command{\n\tUse:   \"delete\",\n\tShort: \"delete the Kubernetes cluster\",\n\tLong:  `Delete the Kubernetes cluster.`,\n\tArgs:  cobra.NoArgs,\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tctx := cmd.Context()\n\t\tapp := newApp()\n\t\tk, err := app.Kubernetes()\n\t\tif err != nil {\n\t\t\treturn err","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/kubernetes.go#L50-L86","documentation":"`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.","triggerScenarios":"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.","commonSituations":"Idempotent cleanup scripts calling stop unconditionally on a fresh machine; double-running the stop command; cluster disabled in the current profile's config.","solutions":["Nothing to do if the goal was 'make sure it is stopped' — the cluster is already down","To actually manage it: `colima start --kubernetes`, verify with `colima kubernetes status`, then stop","In scripts, treat this specific message as success — the command exited non-zero but the desired state is already reached"],"exampleFix":"# before\ncolima kubernetes stop || exit 1\n\n# after\nif ! colima kubernetes status >/dev/null 2>&1; then\n    echo \"kubernetes not running; nothing to stop\"\nelse\n    colima kubernetes stop\nfi","handlingStrategy":"validation","validationCode":"# treat 'not enabled' as already-stopped (idempotent stop)\nif ! colima kubernetes status >/dev/null 2>&1; then\n    echo \"kubernetes not running; nothing to stop\"\nelse\n    colima kubernetes stop\nfi","typeGuard":null,"tryCatchPattern":"if err := stopCmd.Execute(); err != nil {\n    if strings.Contains(err.Error(), \"is not enabled\") {\n        err = nil // desired state already reached\n    }\n}","preventionTips":["Check `colima kubernetes status` before stop/delete in automation","Design scripts to treat this error as success — the end state (cluster stopped) is already true"],"tags":["colima","kubernetes","cli","idempotency","lifecycle"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}