{"record":{"id":"1241c01752ec1f36","repo":"abiosoft/colima","slug":"error-fetching-docker-volumes-w","errorCode":null,"errorMessage":"error fetching docker volumes: %w","messagePattern":"error fetching docker volumes: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"daemon/process/inotify/volumes.go","lineNumber":31,"sourceCode":"\t\"github.com/abiosoft/colima/environment/container/docker\"\n)\n\nfunc (f *inotifyProcess) monitorContainerVolumes(ctx context.Context, c chan<- []string) error {\n\tlog := f.log\n\n\tif f.runtime == \"\" {\n\t\treturn fmt.Errorf(\"empty runtime\")\n\t}\n\n\tfetch := func() ([]string, error) {\n\t\tvar vols []string\n\n\t\tswitch f.runtime {\n\n\t\tcase docker.Name:\n\t\t\tvols, err := f.fetchVolumes(docker.Name)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error fetching docker volumes: %w\", err)\n\t\t\t}\n\t\t\treturn vols, nil\n\n\t\tcase containerd.Name:\n\t\t\tvar namespaces []string\n\t\t\tout, err := f.guest.RunOutput(\"sudo\", \"nerdctl\", \"namespace\", \"list\", \"-q\")\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error retrieving containerd namespaces: %w\", err)\n\t\t\t}\n\t\t\tif out != \"\" {\n\t\t\t\tnamespaces = strings.Fields(out)\n\t\t\t}\n\n\t\t\tfor _, ns := range namespaces {\n\t\t\t\tv, err := f.fetchVolumes(\"sudo\", \"nerdctl\", \"--namespace\", ns)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"error retrieving containerd volumes: %w\", err)\n\t\t\t\t}","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/daemon/process/inotify/volumes.go#L13-L49","documentation":"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.","triggerScenarios":"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.","commonSituations":"the first minutes after `colima start --mount-inotify` with runtime docker; after an abrupt VM kill; a broken docker context/socket inside the guest.","solutions":["wait a few 5s poll cycles — boot-time transients clear themselves","verify docker in the guest: `colima ssh -- docker ps`","restart colima (colima stop && colima start) if the error persists past startup","confirm the VM is actually running: `colima list`"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// probe docker in the guest before relying on volume watching\nif err := guest.RunQuiet(\"docker\", \"ps\"); err != nil {\n    return fmt.Errorf(\"docker not ready in guest yet: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"// the poll loop's own pattern — log and let the next tick retry\ncase <-time.After(volumesInterval):\n    if vols, err := fetch(); err != nil {\n        log.Error(err) // transient: dockerd booting or wedged; retried in 5s\n    } else {\n        c <- vols\n    }","preventionTips":["expect a warm-up window after `colima start` before volume watching engages","verify with `colima ssh -- docker ps` when errors persist past boot","restart colima to reset guest runtime state rather than ignoring a persistent flood"],"tags":["docker","volumes","inotify","transient"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}