{"record":{"id":"66c1126add3e001e","repo":"abiosoft/colima","slug":"error-retrieving-current-runtime-empty-value","errorCode":null,"errorMessage":"error retrieving current runtime: empty value","messagePattern":"error retrieving current runtime: empty value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/app.go","lineNumber":513,"sourceCode":"\t}\n\n\tif kube != nil && kube.Version(ctx) != \"\" {\n\t\tfmt.Println()\n\t\tfmt.Println(kubernetes.Name)\n\t\tfmt.Println(kube.Version(ctx))\n\t}\n\n\treturn nil\n}\n\nfunc (c colimaApp) currentRuntime(ctx context.Context) (string, error) {\n\tif !c.guest.Running(ctx) {\n\t\treturn \"\", fmt.Errorf(\"%s is not running\", config.CurrentProfile().DisplayName)\n\t}\n\n\tr := c.guest.Get(environment.ContainerRuntimeKey)\n\tif r == \"\" {\n\t\treturn \"\", fmt.Errorf(\"error retrieving current runtime: empty value\")\n\t}\n\n\treturn r, nil\n}\n\nfunc (c colimaApp) setRuntime(runtime string) error {\n\terr := store.Set(func(s *store.Store) {\n\t\t// update runtime if runtime disk is in use\n\t\tif s.DiskFormatted {\n\t\t\ts.DiskRuntime = runtime\n\t\t}\n\t})\n\n\tif err != nil {\n\t\tlog.Traceln(fmt.Errorf(\"error persisting store: %w\", err))\n\t}\n\n\treturn c.guest.Set(environment.ContainerRuntimeKey, runtime)","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/app/app.go#L495-L531","documentation":"Thrown by colimaApp.currentRuntime (app/app.go:513) when the Lima VM reports as running but the guest returns an empty string for the 'runtime' key (environment.ContainerRuntimeKey, environment/vm.go:21). It means colima cannot determine which container runtime the active profile was provisioned with, so runtime-dependent operations (Runtime(), Update(), containers()) cannot proceed.","triggerScenarios":"Calling app.Runtime(), app.Update(), or app.containers() while c.guest.Running(ctx) is true but c.guest.Get(\"runtime\") returns \"\". This happens when the VM is up yet provisioning never stored the runtime: a first start that failed midway, the guest agent not yet responsive after boot, or a Lima VM created/started outside colima (e.g. limactl start).","commonSituations":"Running `colima update` immediately after a start that failed during provisioning; interrupting the very first `colima start`; using a profile created by an older colima version whose guest state lacks the runtime key; querying runtime while the guest agent is still booting.","solutions":["Run `colima status -p <profile>` and `colima list`, wait ~10s for the guest agent to settle, then retry the command","Restart the VM so provisioning records the runtime: `colima stop -p <profile> && colima start -p <profile>`","Check guest/SSH logs under the Lima instance dir (~/.colima/_lima/<profile>/*.log) for provisioning failures","If the profile is incomplete or corrupted, `colima delete -p <profile>` and recreate with `colima start --runtime docker`"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-check VM state before any runtime-dependent call\nif !app.Active() {\n    return fmt.Errorf(\"profile not running; start it before querying runtime\")\n}\n// optionally wait for the guest agent to publish the runtime key\n// (simple retry with timeout around app.Runtime())","typeGuard":null,"tryCatchPattern":"if _, err := app.Runtime(); err != nil {\n    if strings.Contains(err.Error(), \"error retrieving current runtime: empty value\") {\n        // guest agent still settling or provisioning incomplete:\n        // wait briefly, restart the VM, or prompt recreation\n        time.Sleep(10 * time.Second)\n        if _, err2 := app.Runtime(); err2 != nil {\n            return fmt.Errorf(\"runtime unavailable after retry: %w\", err2)\n        }\n    } else {\n        return err\n    }\n}","preventionTips":["Always complete `colima start` successfully (watch for provisioning failures) before running `colima update` or querying the runtime","Never start colima profiles directly with limactl — the guest runtime key is only recorded by colima provisioning","After upgrading colima, restart the profile once so guest state is refreshed"],"tags":["runtime","vm","guest-agent","colima","go"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}