{"record":{"id":"dbb58b1e7e1ccd68","repo":"lima-vm/lima","slug":"did-not-receive-an-event-with-the-running-status","errorCode":null,"errorMessage":"did not receive an event with the `running` status","messagePattern":"did not receive an event with the `running` status","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/instance/start.go","lineNumber":445,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t\t_ = ShowMessage(inst)\n\t\t\terr = nil\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tif xerr := hostagentevents.Watch(ctx, haStdoutPath, haStderrPath, begin, true, onEvent); xerr != nil {\n\t\treturn xerr\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !receivedRunningEvent {\n\t\treturn errors.New(\"did not receive an event with the `running` status\")\n\t}\n\n\treturn nil\n}\n\ntype watchHostAgentEventsTimeoutKey = struct{}\n\n// WithWatchHostAgentTimeout sets the value of the timeout to use for\n// watchHostAgentEvents in the given Context.\nfunc WithWatchHostAgentTimeout(ctx context.Context, timeout time.Duration) context.Context {\n\treturn context.WithValue(ctx, watchHostAgentEventsTimeoutKey{}, timeout)\n}\n\ntype launchingShellKey = struct{}\n\n// WithLaunchingShell marks the context as launching a shell after start,\n// suppressing the \"READY. Run ... to open the shell\" message.\nfunc WithLaunchingShell(ctx context.Context) context.Context {","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/instance/start.go#L427-L463","documentation":"watchHostAgentEvents tracks whether at least one event with Status.Running was received before the watcher ended without another error. If the event stream ends (or times out) without a running event, limactl returns this sentinel error. It is the generic 'startup never completed' outcome when the hostagent neither failed loudly nor reported running.","triggerScenarios":"Hostagent event watch ends (context timeout or stream close) with receivedRunningEvent still false — e.g. hostagent hangs during provisioning, watchHostAgentTimeout elapses, or event delivery is interrupted.","commonSituations":"Very slow first boot (large image download, slow disk) exceeding the default watch timeout, hung provisioning scripts, or guestagent never registering.","solutions":["Increase the timeout: `limactl start --timeout <duration>` (or set via the watch timeout context key)","Check ha.stderr.log and instance logs for silent hangs","Kill hung provisioning steps in lima.yaml or add timeouts to them","Retry the start; if repeated, recreate the instance"],"exampleFix":"// before\nlimactl start my-instance\n// after\nlimactl start --timeout 30m my-instance","handlingStrategy":"retry","validationCode":"// give slow first boots enough time\nlimactl start --timeout 30m my-instance","typeGuard":null,"tryCatchPattern":"err := start()\nif err != nil && strings.Contains(err.Error(), \"did not receive an event with the `running` status\") {\n    time.Sleep(5 * time.Second)\n    return start() // retry once with a larger timeout\n}","preventionTips":["Always pass an explicit generous --timeout for first boots","Avoid blocking provisioning scripts (add timeouts inside them)","Monitor ha.stderr.log for hangs","Pre-download images before `limactl start`"],"tags":["hostagent","timeout","vm-startup"],"backgroundTag":"vm-startup-timeout","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}