{"record":{"id":"9469dd8e83f4968d","repo":"lima-vm/lima","slug":"unable-to-load-instance-s-w","errorCode":null,"errorMessage":"unable to load instance %s: %w","messagePattern":"unable to load instance (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/list.go","lineNumber":247,"sourceCode":"\t}\n\n\t// get the state and config for all the requested instances\n\tvar instances []*limatype.Instance\n\tfor _, instanceName := range instanceNames {\n\t\tinstance, err := store.Inspect(ctx, instanceName)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\t\tif broken := brokenInstance(instanceName, err); broken != nil {\n\t\t\t\t\tinstances = append(instances, broken)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tlogrus.Warnf(\"Skipping instance %#q: %v (being cloned or deleted?)\", instanceName, err)\n\t\t\t\tif len(args) > 0 {\n\t\t\t\t\tunmatchedInstances = true\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"unable to load instance %s: %w\", instanceName, err)\n\t\t}\n\t\tinstances = append(instances, instance)\n\t}\n\n\tif len(filter) > 0 {\n\t\tvar filterExprs []string\n\t\tfor _, f := range filter {\n\t\t\tfilterExprs = append(filterExprs, \"select(\"+f+\")\")\n\t\t}\n\t\tinstances, err = filterInstances(ctx, instances, filterExprs)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif quiet && len(yq) == 0 {\n\t\tfor _, instance := range instances {\n\t\t\tfmt.Fprintln(cmd.OutOrStdout(), instance.Name)","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/list.go#L229-L265","documentation":"limactl list wraps any failure to load an instance's on-disk state (the per-instance directory under $LIMA_HOME containing lima.yaml, etc.) into this error. It is thrown by listAction in cmd/limactl/list.go:247 when store.LoadInstance (or similar) returns an error that is not a 'being cloned or deleted' transient condition — those are skipped with a warning instead. The %w wrapping preserves the underlying cause (file missing, YAML parse error, permission denied).","triggerScenarios":"Running `limactl list <name>` (or with explicit instance args) where the instance directory exists but its lima.yaml is corrupt, unreadable, or the directory was partially deleted/created outside a state that the loader recognizes, and the load error is not the transient in-progress error.","commonSituations":"Interrupted `limactl create/delete/clone` leaving a half-written instance dir; manually editing or truncating lima.yaml; $LIMA_HOME on a mounted volume with permission issues; stale instance dirs after a Lima version upgrade changed the config format.","solutions":["Inspect the instance directory ($LIMA_HOME/lima/<name>/lima.yaml) and fix or restore the YAML","If the instance is dead, remove it: `limactl delete -f <name>` or manually delete the directory and re-list","Check file permissions on $LIMA_HOME subdirectories (should be readable by the current user)","Run `limactl list` without arguments to see which instances load and which warn/skip"],"exampleFix":"// before (broken instance dir)\n$ limactl list myvm\nError: unable to load instance myvm: open .../lima.yaml: no such file or directory\n// after\n$ rm -rf ~/.lima/myvm   # or fix lima.yaml\n$ limactl list","handlingStrategy":"validation","validationCode":"if [ ! -f \"$LIMA_HOME/lima/$NAME/lima.yaml\" ]; then echo \"instance $NAME missing/broken\"; exit 1; fi","typeGuard":"func instanceLoadable(limaDir, name string) bool {\n\tinfo, err := os.Stat(filepath.Join(limaDir, \"lima\", name, \"lima.yaml\"))\n\treturn err == nil && !info.IsDir()\n}","tryCatchPattern":"instance, err := store.LoadInstance(ctx, instDir, name)\nif err != nil {\n\tif errors.Is(err, os.ErrNotExist) { /* recreate or delete stale dir */ }\n\treturn fmt.Errorf(\"unable to load instance %s: %w\", name, err)\n}","preventionTips":["Never kill limactl mid create/delete; let lifecycle commands finish","Avoid hand-editing lima.yaml in $LIMA_HOME; use `limactl edit`","Keep $LIMA_HOME off NFS/unreliable mounts (limactl already warns about NFS)","Periodically prune dead instances with `limactl delete -f`"],"tags":["cli","instances","filesystem"],"backgroundTag":"instance-load-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}