{"record":{"id":"7f3b04ec1466f98e","repo":"abiosoft/colima","slug":"error-decoding-remotes-response-w","errorCode":null,"errorMessage":"error decoding remotes response: %w","messagePattern":"error decoding remotes response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"environment/container/incus/incus.go","lineNumber":368,"sourceCode":"func (c incusRuntime) hasRemote(name string) bool {\n\tremotes, err := c.fetchRemotes()\n\tif err != nil {\n\t\treturn false\n\t}\n\n\t_, ok := remotes[name]\n\treturn ok\n}\n\nfunc (c incusRuntime) fetchRemotes() (remoteInfo, error) {\n\tb, err := c.host.RunOutput(\"incus\", \"remote\", \"list\", \"--format\", \"json\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error fetching remotes: %w\", err)\n\t}\n\n\tvar remotes remoteInfo\n\tif err := json.NewDecoder(strings.NewReader(b)).Decode(&remotes); err != nil {\n\t\treturn nil, fmt.Errorf(\"error decoding remotes response: %w\", err)\n\t}\n\n\treturn remotes, nil\n}\n\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}","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/container/incus/incus.go#L350-L386","documentation":"The JSON emitted by host 'incus remote list --format json' could not be decoded into the remoteInfo map. Either the command printed non-JSON ahead of the payload (warnings, update notices), or the incus version changed the JSON shape so the Go struct no longer matches.","triggerScenarios":"json.Decode into remoteInfo fails: stdout contains log/warning lines before JSON, incus prints a deprecation notice, or the schema of remote entries changed (renamed/added required fields) across versions.","commonSituations":"Host incus auto-update notice printed to stdout, older/newer incus than colima supports, locale-specific output, or a partially written client config producing warning output.","solutions":["Run 'incus remote list --format json' on the host and paste the output into a JSON validator to spot non-JSON prefix","Align versions: upgrade colima to a release supporting your host incus, or pin incus to a compatible version","Clear host incus update notices / re-run the command to dismiss one-time warnings","Report the output shape to colima maintainers if a new incus schema is the cause"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// strip non-JSON noise before decoding: keep from first '{'\nif i := strings.Index(b, \"{\"); i > 0 {\n    b = b[i:]\n}\nvar remotes remoteInfo\nif err := json.NewDecoder(strings.NewReader(b)).Decode(&remotes); err != nil {\n    return nil, fmt.Errorf(\"error decoding remotes response: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"var remotes remoteInfo\nif err := json.Unmarshal([]byte(strings.TrimSpace(b)), &remotes); err != nil {\n    if strings.HasPrefix(strings.TrimSpace(b), \"{\") {\n        return nil, fmt.Errorf(\"incus remote schema changed, upgrade colima: %w\", err)\n    }\n    return nil, fmt.Errorf(\"non-JSON output from incus: %w\", err)\n}","preventionTips":["Keep host incus quiet: dismiss update notices before running colima","Match colima and host incus versions per the support matrix","Treat unexpected decode failures as version-skew signals first"],"tags":["incus","json","parsing","host","versioning"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}