lima-vm/lima · error

errors inspecting instance: %+v

Error message

errors inspecting instance: %+v

What it means

createAction loads or creates the instance and then inspects it; the Instance.Errors field collects errors encountered while reading the instance's on-disk state (lima.yaml, disk files, etc.). If any inspection errors accumulated, createAction aborts with this aggregated error before preparing the instance.

Source

Thrown at cmd/limactl/start.go:576

		if !strings.HasPrefix(f.Name, "_") {
			filtered = append(filtered, f)
		}
	}
	return filtered, nil
}

func createAction(cmd *cobra.Command, args []string) error {
	if exit, err := createStartActionCommon(cmd, args); err != nil {
		return err
	} else if exit {
		return nil
	}
	inst, err := loadOrCreateInstance(cmd, args, true)
	if err != nil {
		return err
	}
	if len(inst.Errors) > 0 {
		return fmt.Errorf("errors inspecting instance: %+v", inst.Errors)
	}
	if _, err = instance.Prepare(cmd.Context(), inst, ""); err != nil {
		return err
	}
	server.Stop(inst.Dir, true)
	logrus.Infof("Run `limactl start %s` to start the instance.", inst.Name)
	return nil
}

func startAction(cmd *cobra.Command, args []string) error {
	if exit, err := createStartActionCommon(cmd, args); err != nil {
		return err
	} else if exit {
		return nil
	}
	inst, err := loadOrCreateInstance(cmd, args, false)
	if err != nil {
		return err

View on GitHub (pinned to dd909d0973)

Solutions

  1. Read the wrapped errors (%+v output) to see which field/file failed
  2. Fix or restore ~/.lima/<instance>/lima.yaml to pass limayaml validation
  3. Remove and recreate the instance with `limactl delete <name>` then `limactl create`

Example fix

// before: broken stored yaml
// after
limactl delete myinstance
limactl create template://default --name myinstance
Defensive patterns

Strategy: validation

Validate before calling

// validate stored instance config before create
limactl validate ~/.lima/myinstance/lima.yaml || limactl delete myinstance

Try / catch

if ! limactl create --name myinstance template://default 2>&1; then
  case "$?" in *errors\ inspecting*) limactl delete myinstance && limactl create --name myinstance template://default;;
  esac
fi

Prevention

When it happens

Trigger: `limactl create` on an existing instance directory whose stored lima.yaml or other state files fail to load/validate, populating inst.Errors.

Common situations: Hand-edited or truncated ~/.lima/<instance>/lima.yaml; instance dir copied from another machine or LIMA_HOME; schema changes after a Lima version upgrade leaving obsolete fields.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/68c71842286b60c2. Report an issue: GitHub.