{"record":{"id":"8fdc1d285ac4f3e0","repo":"lima-vm/lima","slug":"no-requeststart-function-available","errorCode":null,"errorMessage":"no RequestStart function available","messagePattern":"no RequestStart function available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/autostart/managers.go","lineNumber":141,"sourceCode":"\tdata := map[string]string{\n\t\t\"Binary\":   selfExeAbs,\n\t\t\"Instance\": instName,\n\t\t\"WorkDir\":  workDir,\n\t}\n\tmaps.Copy(data, t.extraTemplateVars)\n\treturn textutil.ExecuteTemplate(t.template, data)\n}\n\nfunc (t *TemplateFileBasedManager) AutoStartedIdentifier() string {\n\tif t.autoStartedIdentifier != nil {\n\t\treturn t.autoStartedIdentifier()\n\t}\n\treturn \"\"\n}\n\nfunc (t *TemplateFileBasedManager) RequestStart(ctx context.Context, inst *limatype.Instance) error {\n\tif t.requestStart == nil {\n\t\treturn errors.New(\"no RequestStart function available\")\n\t}\n\treturn t.requestStart(ctx, inst)\n}\n\nfunc (t *TemplateFileBasedManager) RequestStop(ctx context.Context, inst *limatype.Instance) (bool, error) {\n\tif t.requestStop == nil {\n\t\treturn false, errors.New(\"no RequestStop function available\")\n\t}\n\treturn t.requestStop(ctx, inst)\n}\n","sourceCodeStart":123,"sourceCodeEnd":152,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/autostart/managers.go#L123-L152","documentation":"TemplateFileBasedManager.RequestStart delegates to an injected requestStart callback (e.g. the systemd package's systemctl-based start). If that callback was never wired, the manager cannot start the instance and returns this sentinel error immediately.","triggerScenarios":"Calling RequestStart on a manager that lacks the requestStart function — typically a hand-constructed TemplateFileBasedManager, or a platform build where the callback is intentionally not implemented.","commonSituations":"Custom Lima builds or embedders constructing the manager directly; tests that construct partial managers; future platform ports where RequestStart is not yet supported.","solutions":["Use the standard OS-specific manager constructor so requestStart is wired to the systemd/launchd implementation","If implementing your own manager, supply requestStart (e.g. pkg/autostart/systemd.RequestStart)","Catch this error and fall back to starting the instance via `limactl start <instance>` directly"],"exampleFix":"// before: partial manager\nmgr := &autostart.TemplateFileBasedManager{template: tpl}\n// after: wire the callbacks\nmgr := &autostart.TemplateFileBasedManager{\n    template: tpl,\n    requestStart: systemd.RequestStart,\n    requestStop:  systemd.RequestStop,\n}","handlingStrategy":"fallback","validationCode":"// only request start via autostart when the instance has a registered entry\nregistered, err := mgr.IsRegistered(ctx, inst)\nif err != nil || !registered {\n    return limainstance.Start(ctx, inst) // normal path\n}\n","typeGuard":null,"tryCatchPattern":"if err := mgr.RequestStart(ctx, inst); err != nil {\n    if strings.Contains(err.Error(), \"no RequestStart function available\") {\n        return limainstance.Start(ctx, inst) // fallback to normal start\n    }\n    return err\n}\n","preventionTips":["Use the standard constructors which wire requestStart to the systemd/launchd implementation","When embedding, always populate requestStart and requestStop together","Start instances via limactl start unless you know autostart is fully configured on the platform"],"tags":["autostart","api-misuse","configuration"],"backgroundTag":"missing-callback-implementation","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}