{"record":{"id":"d4bb53b5e04263ed","repo":"lima-vm/lima","slug":"instance-q-not-found-d4bb53","errorCode":null,"errorMessage":"instance %q not found","messagePattern":"instance %q not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/autostart_others.go","lineNumber":33,"sourceCode":"\n\t\"github.com/lima-vm/lima/v2/pkg/autostart\"\n\t\"github.com/lima-vm/lima/v2/pkg/store\"\n)\n\nfunc autostartEnableAction(cmd *cobra.Command, args []string) error {\n\tcondition, err := cmd.Flags().GetString(\"condition\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif condition == \"boot\" {\n\t\treturn errors.New(\"--condition=boot is only supported on macOS\")\n\t}\n\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\tkeepAlive, err := cmd.Flags().GetBool(\"keep-alive\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tmgr := autostart.ManagerWith(keepAlive)\n\tif err := mgr.RegisterToStartAtLogin(ctx, inst); err != nil {\n\t\treturn fmt.Errorf(\"failed to register instance %#q to start at login: %w\", inst.Name, err)\n\t}\n\tlogrus.Infof(\"Instance %#q registered to start at login\", inst.Name)\n\treturn nil\n}\n\nfunc autostartDisableAction(cmd *cobra.Command, args []string) error {\n\tctx := cmd.Context()","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/autostart_others.go#L15-L51","documentation":"autostartEnableAction calls store.Inspect(ctx, args[0]) to load the instance; when the returned error matches os.ErrNotExist it is rewritten to this message. It means no instance with the given name exists under ${LIMA_HOME} (no <name>.yaml in the instances directory).","triggerScenarios":"`limactl autostart <name>` (or with --condition) where <name> does not match an existing instance: typo in the name, instance deleted, or LIMA_HOME pointing to a different Lima data directory than the one holding the instance.","commonSituations":"Typo'd instance name; running limactl with a custom LIMA_HOME that lacks the instance; instance removed by `limactl delete` but autostart still configured in scripts; new machine without `limactl create` having been run.","solutions":["List instances with `limactl list` and use the exact name","Check LIMA_HOME points at the intended data directory (`echo $LIMA_HOME`)","Create the instance first with `limactl create <template> --name=<name>` if it never existed","Quote the name in shell scripts to avoid mangling"],"exampleFix":"// before: limactl autostart myinstence\n// after:  limactl list && limactl autostart myinstance","handlingStrategy":"validation","validationCode":"if ! limactl list | awk '{print $1}' | grep -qx \"$INSTANCE\"; then\n  echo \"instance '$INSTANCE' does not exist\"; exit 1\nfi","typeGuard":null,"tryCatchPattern":"try:\n  subprocess.run([\"limactl\", \"autostart\", name], check=True)\nexcept subprocess.CalledProcessError as e:\n  if 'not found' in e.stderr.decode():\n    print(f\"Instance '{name}' missing - run 'limactl list' or create it first\")\n  else:\n    raise","preventionTips":["Always `limactl list` before scripting against an instance name","Pin LIMA_HOME in scripts so enable/disable target the same store","Quote instance names in shell to avoid truncation/word-splitting","Recreate the instance before re-enabling autostart after deletion"],"tags":["instance","cli","not-found"],"backgroundTag":"instance-not-found","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}