abiosoft/colima · error

error listing networks: %w

Error message

error listing networks: %w

What it means

Colima runs 'sudo incus network list --format json' inside the GUEST VM and the command failed. This is used by findNetwork to detect whether the incus bridge is already provisioned; failure means the incus daemon in the guest is not answering or sudo/exec itself failed.

Source

Thrown at environment/container/incus/incus.go:391

func (c incusRuntime) isDefaultRemote() bool {
	remote, _ := c.host.RunOutput("incus", "remote", "get-default")
	return remote == config.CurrentProfile().ID
}

func (c incusRuntime) addDockerRemote() error {
	if c.hasRemote("docker") {
		// already added
		return nil
	}

	return c.host.RunQuiet("incus", "remote", "add", "docker", "https://docker.io", "--protocol=oci")
}

func (c incusRuntime) findNetwork(interfaceName string) (found bool, info networkInfo, err error) {
	b, err := c.guest.RunOutput("sudo", "incus", "network", "list", "--format", "json")
	if err != nil {
		return found, info, fmt.Errorf("error listing networks: %w", err)
	}
	var resp []networkInfo
	if err := json.NewDecoder(strings.NewReader(b)).Decode(&resp); err != nil {
		return found, info, fmt.Errorf("error decoding networks into struct: %w", err)
	}
	for _, n := range resp {
		if n.Name == interfaceName {
			return true, n, nil
		}
	}

	return
}

//go:embed config.yaml
var configYaml string

type remoteInfo map[string]struct {

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Check daemon status: 'colima ssh -- sudo systemctl status incus.service incus.socket'
  2. Restart the guest: 'colima stop && colima start'
  3. Verify guest incus works at all: 'colima ssh -- sudo incus network list'
  4. Reprovision if guest state is unrecoverable: 'colima delete && colima start'
Defensive patterns

Strategy: retry

Validate before calling

// ensure socket-activated daemon answers before querying
if err := c.guest.RunQuiet("sudo", "incus", "query", "/1.0"); err != nil {
    if err2 := c.systemctl.Start("incus.socket"); err2 != nil {
        return false, fmt.Errorf("incus daemon unavailable: %w", err2)
    }
}

Try / catch

b, err := c.guest.RunOutput("sudo", "incus", "network", "list", "--format", "json")
if err != nil {
    // socket activation may be cold on first boot: one retry after starting units
    _ = c.systemctl.Start("incus.service")
    if b, err = c.guest.RunOutput("sudo", "incus", "network", "list", "--format", "json"); err != nil {
        return false, info, fmt.Errorf("error listing networks: %w", err)
    }
}

Prevention

When it happens

Trigger: guest.RunOutput('sudo','incus','network','list','--format','json') errors: incus.service/incus.socket not running in the guest, guest incus binary missing, sudo prompt/failure, or SSH to guest broken.

Common situations: incus socket activation failing after boot (PreMount stopped the units), interrupted provisioning left the daemon down, guest disk full preventing socket creation.

Related errors


AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15). Data as JSON: /api/errors/1e188f25305128b0. Report an issue: GitHub.