{"record":{"id":"59195bac5b8b7369","repo":"abiosoft/colima","slug":"s-is-not-running-59195b","errorCode":null,"errorMessage":"%s is not running","messagePattern":"(.+?) is not running","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kubernetes.go","lineNumber":27,"sourceCode":"\t\"github.com/abiosoft/colima/environment/container/kubernetes\"\n\n\t\"github.com/spf13/cobra\"\n)\n\n// kubernetesCmd represents the kubernetes command\nvar kubernetesCmd = &cobra.Command{\n\tUse:     \"kubernetes\",\n\tAliases: []string{\"kube\", \"k8s\", \"k3s\", \"k\"},\n\tShort:   \"manage Kubernetes cluster\",\n\tLong:    `Manage the Kubernetes cluster`,\n\tPersistentPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t// cobra overrides PersistentPreRunE when redeclared.\n\t\t// re-run rootCmd's.\n\t\tif err := root.Cmd().PersistentPreRunE(cmd, args); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !newApp().Active() {\n\t\t\treturn fmt.Errorf(\"%s is not running\", config.CurrentProfile().DisplayName)\n\t\t}\n\t\treturn nil\n\t},\n}\n\n// kubernetesStartCmd represents the kubernetes start command\nvar kubernetesStartCmd = &cobra.Command{\n\tUse:   \"start\",\n\tShort: \"start the Kubernetes cluster\",\n\tLong:  `Start the Kubernetes cluster.`,\n\tArgs:  cobra.NoArgs,\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tapp := newApp()\n\t\tk, err := app.Kubernetes()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/kubernetes.go#L9-L45","documentation":"Every `colima kubernetes <sub>` command re-runs rootCmd's PersistentPreRunE and then requires newApp().Active() — the colima VM for the CURRENT profile must be running. This error means the VM is stopped (or was never created), so Kubernetes management commands are rejected before they reach their RunE. The %s is the profile's DisplayName.","triggerScenarios":"Running any `colima kubernetes ...` subcommand while the VM is stopped or deleted; targeting a profile that was never started (COLIMA_PROFILE env or --profile flag pointing at an inactive profile); issuing the command immediately after `colima stop` or before the first `colima start`.","commonSituations":"Fresh install where the user expects `colima kubernetes start` to boot everything; shell profile exporting COLIMA_PROFILE to a stale name; scripts assuming a prior `colima start` succeeded; VM still booting after host reboot without autostart.","solutions":["Start the VM first: `colima start` (or `colima start --kubernetes` to enable the cluster in the same boot)","Confirm state with `colima status`, then re-run the kubernetes subcommand","If the profile name in the message is unexpected, check COLIMA_PROFILE / `colima --profile <name>` and target the right profile"],"exampleFix":"# before\n$ colima kubernetes start\nerror: colima is not running\n\n# after\n$ colima start --kubernetes && colima kubernetes status","handlingStrategy":"validation","validationCode":"# shell: gate kubernetes commands on a running VM\ncolima status >/dev/null 2>&1 || colima start --kubernetes\ncolima kubernetes start","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always `colima start` (or `colima start --kubernetes`) before any kubernetes subcommand","Check `colima status` in scripts before issuing cluster commands","Verify COLIMA_PROFILE / --profile matches the VM you started — a wrong profile is the most common silent cause"],"tags":["colima","kubernetes","cli","precondition","profile"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}