{"record":{"id":"25c234cae8340205","repo":"lima-vm/lima","slug":"failed-to-unregister-instance-q-from-start-at-lo-25c234","errorCode":null,"errorMessage":"failed to unregister instance %#q from start at login: %w","messagePattern":"failed to unregister instance %#q from start at login: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/autostart_others.go","lineNumber":68,"sourceCode":"func autostartDisableAction(cmd *cobra.Command, args []string) error {\n\tctx := cmd.Context()\n\tinst, err := store.Inspect(ctx, args[0])\n\tif err != nil {\n\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\treturn fmt.Errorf(\"instance %q not found\", args[0])\n\t\t}\n\t\treturn err\n\t}\n\n\tif registered, err := autostart.IsRegistered(ctx, inst); err != nil {\n\t\treturn err\n\t} else if !registered {\n\t\tlogrus.Infof(\"Instance %#q is not registered for automatic startup\", inst.Name)\n\t\treturn nil\n\t}\n\n\tif err := autostart.UnregisterFromStartAtLogin(ctx, inst); err != nil {\n\t\treturn fmt.Errorf(\"failed to unregister instance %#q from start at login: %w\", inst.Name, err)\n\t}\n\tlogrus.Infof(\"Instance %#q unregistered from start at login\", inst.Name)\n\treturn nil\n}\n","sourceCodeStart":50,"sourceCodeEnd":73,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/autostart_others.go#L50-L73","documentation":"limactl unregister (autostart disable) failed to remove the instance's entry from the login-time autostart mechanism. The instance was previously registered with `limactl start --autostart`, and the platform-specific autostart helper (launchd/systemd/Task Scheduler wrapper) returned an error while removing its entry. The original error is wrapped so the root cause (permissions, missing service file) is preserved.","triggerScenarios":"Running `limactl unregister <instance>` (or equivalent autostartDisableAction) when the instance has an autostart entry (registered=true) and autostart.UnregisterFromStartAtLogin fails, e.g. the platform autostart file/directory is unwritable or was deleted externally.","commonSituations":"Removing a launchd/systemd user file manually then trying to unregister; running limactl under a user without permission to the autostart directory; partially deleted ${LIMA_HOME}/_config/autostart entries.","solutions":["Fix the underlying wrapped error (usually a filesystem permission or missing file issue in the autostart config dir)","Check permissions on ~/.config/systemd/user (Linux), ~/Library/LaunchAgents (macOS), or the Windows Startup folder and re-run as the same user that registered the entry","If the entry is already gone, verify with `limactl list` / inspect the autostart dir; re-register then unregister again to reset state","As a last resort, manually delete the instance's autostart file and re-run the command"],"exampleFix":"// before\n$ limactl unregister myvm\n// failed to unregister instance \"myvm\" from start at login: ...\n// after\n$ ls ~/Library/LaunchAgents   # or ~/.config/systemd/user\n$ chmod u+w <autostart-dir>   # fix permissions\n$ limactl unregister myvm","handlingStrategy":"try-catch","validationCode":"const registered = await isAutostartRegistered(inst)\nif (!registered) return null // nothing to unregister","typeGuard":"function isPermissionErr(err: unknown): boolean {\n  return err instanceof Error && /permission denied|EACCES|ENOENT/.test(err.message)\n}","tryCatchPattern":"try {\n  await unregisterFromStartAtLogin(inst)\n} catch (err) {\n  if (isPermissionErr(err)) {\n    console.error('Check perms on the autostart dir; fix and retry:', err)\n  } else {\n    throw err\n  }\n}","preventionTips":["Unregister with the same OS user that registered the autostart entry","Do not hand-delete autostart files; always use limactl commands","Keep ${LIMA_HOME} on a local filesystem with writable user config dirs"],"tags":["autostart","limactl","filesystem"],"backgroundTag":"autostart-unregister-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}