{"record":{"id":"1e188f25305128b0","repo":"abiosoft/colima","slug":"error-listing-networks-w","errorCode":null,"errorMessage":"error listing networks: %w","messagePattern":"error listing networks: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"environment/container/incus/incus.go","lineNumber":391,"sourceCode":"\nfunc (c incusRuntime) isDefaultRemote() bool {\n\tremote, _ := c.host.RunOutput(\"incus\", \"remote\", \"get-default\")\n\treturn remote == config.CurrentProfile().ID\n}\n\nfunc (c incusRuntime) addDockerRemote() error {\n\tif c.hasRemote(\"docker\") {\n\t\t// already added\n\t\treturn nil\n\t}\n\n\treturn c.host.RunQuiet(\"incus\", \"remote\", \"add\", \"docker\", \"https://docker.io\", \"--protocol=oci\")\n}\n\nfunc (c incusRuntime) findNetwork(interfaceName string) (found bool, info networkInfo, err error) {\n\tb, err := c.guest.RunOutput(\"sudo\", \"incus\", \"network\", \"list\", \"--format\", \"json\")\n\tif err != nil {\n\t\treturn found, info, fmt.Errorf(\"error listing networks: %w\", err)\n\t}\n\tvar resp []networkInfo\n\tif err := json.NewDecoder(strings.NewReader(b)).Decode(&resp); err != nil {\n\t\treturn found, info, fmt.Errorf(\"error decoding networks into struct: %w\", err)\n\t}\n\tfor _, n := range resp {\n\t\tif n.Name == interfaceName {\n\t\t\treturn true, n, nil\n\t\t}\n\t}\n\n\treturn\n}\n\n//go:embed config.yaml\nvar configYaml string\n\ntype remoteInfo map[string]struct {","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/container/incus/incus.go#L373-L409","documentation":"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.","triggerScenarios":"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.","commonSituations":"incus socket activation failing after boot (PreMount stopped the units), interrupted provisioning left the daemon down, guest disk full preventing socket creation.","solutions":["Check daemon status: 'colima ssh -- sudo systemctl status incus.service incus.socket'","Restart the guest: 'colima stop && colima start'","Verify guest incus works at all: 'colima ssh -- sudo incus network list'","Reprovision if guest state is unrecoverable: 'colima delete && colima start'"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure socket-activated daemon answers before querying\nif err := c.guest.RunQuiet(\"sudo\", \"incus\", \"query\", \"/1.0\"); err != nil {\n    if err2 := c.systemctl.Start(\"incus.socket\"); err2 != nil {\n        return false, fmt.Errorf(\"incus daemon unavailable: %w\", err2)\n    }\n}","typeGuard":null,"tryCatchPattern":"b, err := c.guest.RunOutput(\"sudo\", \"incus\", \"network\", \"list\", \"--format\", \"json\")\nif err != nil {\n    // socket activation may be cold on first boot: one retry after starting units\n    _ = c.systemctl.Start(\"incus.service\")\n    if b, err = c.guest.RunOutput(\"sudo\", \"incus\", \"network\", \"list\", \"--format\", \"json\"); err != nil {\n        return false, info, fmt.Errorf(\"error listing networks: %w\", err)\n    }\n}","preventionTips":["Keep guest incus.service/incus.socket enabled so socket activation works","Reboot the guest with 'colima stop && colima start' after guest upgrades","Avoid stopping incus units manually inside the VM"],"tags":["incus","network","vm","daemon"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}