abiosoft/colima · warning

error fetching docker volumes: %w

Error message

error fetching docker volumes: %w

What it means

When runtime is docker, the 5-second volume poll calls fetchVolumes("docker") inside the guest (docker ps -q, then docker inspect). Any failure there is wrapped as 'error fetching docker volumes' and logged by the poll goroutine — it is non-fatal and retried every 5 seconds, but it means container volumes are not being watched until a fetch succeeds.

Source

Thrown at daemon/process/inotify/volumes.go:31

	"github.com/abiosoft/colima/environment/container/docker"
)

func (f *inotifyProcess) monitorContainerVolumes(ctx context.Context, c chan<- []string) error {
	log := f.log

	if f.runtime == "" {
		return fmt.Errorf("empty runtime")
	}

	fetch := func() ([]string, error) {
		var vols []string

		switch f.runtime {

		case docker.Name:
			vols, err := f.fetchVolumes(docker.Name)
			if err != nil {
				return nil, fmt.Errorf("error fetching docker volumes: %w", err)
			}
			return vols, nil

		case containerd.Name:
			var namespaces []string
			out, err := f.guest.RunOutput("sudo", "nerdctl", "namespace", "list", "-q")
			if err != nil {
				return nil, fmt.Errorf("error retrieving containerd namespaces: %w", err)
			}
			if out != "" {
				namespaces = strings.Fields(out)
			}

			for _, ns := range namespaces {
				v, err := f.fetchVolumes("sudo", "nerdctl", "--namespace", ns)
				if err != nil {
					return nil, fmt.Errorf("error retrieving containerd volumes: %w", err)
				}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. wait a few 5s poll cycles — boot-time transients clear themselves
  2. verify docker in the guest: `colima ssh -- docker ps`
  3. restart colima (colima stop && colima start) if the error persists past startup
  4. confirm the VM is actually running: `colima list`
Defensive patterns

Strategy: retry

Validate before calling

// probe docker in the guest before relying on volume watching
if err := guest.RunQuiet("docker", "ps"); err != nil {
    return fmt.Errorf("docker not ready in guest yet: %w", err)
}

Try / catch

// the poll loop's own pattern — log and let the next tick retry
case <-time.After(volumesInterval):
    if vols, err := fetch(); err != nil {
        log.Error(err) // transient: dockerd booting or wedged; retried in 5s
    } else {
        c <- vols
    }

Prevention

When it happens

Trigger: dockerd inside the VM not yet up during boot (transient for a few poll cycles); docker daemon in the guest stopped or wedged; guest unreachable; containers in a state where ps/inspect fails.

Common situations: the first minutes after `colima start --mount-inotify` with runtime docker; after an abrupt VM kill; a broken docker context/socket inside the guest.

Related errors


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