lima-vm/lima · error

failed to get Info from %#q: %w

Error message

failed to get Info from %#q: %w

What it means

Inspect() successfully connected to the host agent socket but the Info() RPC failed within the 3-second timeout. The instance is marked StatusBroken. This means the host agent is listening but not answering properly (hung, overloaded, or protocol mismatch).

Source

Thrown at pkg/store/instance.go:83

	inst.HostAgentPID, err = ReadPIDFile(filepath.Join(instDir, filenames.HostAgentPID))
	if err != nil {
		inst.Status = limatype.StatusBroken
		inst.Errors = append(inst.Errors, err)
	}

	if inst.HostAgentPID != 0 {
		haSock := filepath.Join(instDir, filenames.HostAgentSock)
		haClient, err := hostagentclient.NewHostAgentClient(haSock)
		if err != nil {
			inst.Status = limatype.StatusBroken
			inst.Errors = append(inst.Errors, fmt.Errorf("failed to connect to %#q: %w", haSock, err))
		} else {
			ctx, cancel := context.WithTimeout(ctx, 3*time.Second)
			defer cancel()
			info, err := haClient.Info(ctx)
			if err != nil {
				inst.Status = limatype.StatusBroken
				inst.Errors = append(inst.Errors, fmt.Errorf("failed to get Info from %#q: %w", haSock, err))
			} else {
				inst.SSHLocalPort = info.SSHLocalPort
				inst.AutoStartedIdentifier = info.AutoStartedIdentifier
			}
		}
	}
	if inst.SSHLocalPort == 0 {
		sshConfigPath := filepath.Join(instDir, filenames.SSHConfig)
		if port, err := sshPortFromConfig(sshConfigPath); err == nil {
			inst.SSHLocalPort = port
		} else if !errors.Is(err, os.ErrNotExist) {
			inst.Errors = append(inst.Errors, fmt.Errorf("failed to extract SSH local port from %#q: %w", sshConfigPath, err))
		}
	}

	inst.CPUs = *y.CPUs
	memory, err := units.RAMInBytes(*y.Memory)
	if err == nil {

View on GitHub (pinned to dd909d0973)

Solutions

  1. Retry once after a few seconds (transient load can exceed the 3s deadline)
  2. Stop and restart the instance: `limactl stop <inst>` then `limactl start <inst>`
  3. If stop fails, kill the stale hostagent PID from ~/.lima/<inst>/ha.pid and restart
  4. Ensure limactl and hostagent versions match (reinstall Lima if mixed versions)

Example fix

// before: limactl inspect hangs/fails on Info
// after: force-clean the wedged agent
kill $(cat ~/.lima/myvm/ha.pid); limactl start myvm
Defensive patterns

Strategy: retry

Validate before calling

// Probe the socket before heavy use
conn, err := net.DialTimeout("unix", haSock, 2*time.Second)
if err == nil { conn.Close() }

Try / catch

var rpcErr error
for i := 0; i < 3; i++ {
    info, err = haClient.Info(ctx)
    if err == nil { break }
    rpcErr = err
    time.Sleep(time.Second)
}
if rpcErr != nil { /* stop+restart instance */ }

Prevention

When it happens

Trigger: haClient.Info(ctx) returns an error or times out within 3s: host agent is alive but wedged, gRPC deadline exceeded, host agent binary version mismatch with limactl, or the agent is blocked on I/O.

Common situations: Host agent deadlocked during VM shutdown; host machine under heavy load exceeding the 3s timeout; limactl upgraded while old hostagent still running (protobuf/API mismatch); socket alive but process is a zombie.

Related errors


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