{"record":{"id":"b1921f4a88018e7e","repo":"gastownhall/beads","slug":"dolt-remote-v-failed-s-w","errorCode":null,"errorMessage":"dolt remote -v failed: %s: %w","messagePattern":"dolt remote -v failed: (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/doltutil/remotes.go","lineNumber":124,"sourceCode":"\tremotes := make([]storage.RemoteInfo, 0, len(state.Remotes))\n\tfor name, r := range state.Remotes {\n\t\tremotes = append(remotes, storage.RemoteInfo{Name: name, URL: r.URL})\n\t}\n\tsort.Slice(remotes, func(i, j int) bool { return remotes[i].Name < remotes[j].Name })\n\treturn remotes, nil\n}\n\n// ListCLIRemotes parses `dolt remote -v` output from the given database\n// directory. This is a read-only guard for deciding whether CLI push/pull/fetch\n// can safely run from that directory; remote mutation still goes through SQL.\nfunc ListCLIRemotes(dbPath string) ([]storage.RemoteInfo, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), listCLIRemotesTimeout(dbPath))\n\tdefer cancel()\n\tcmd := exec.CommandContext(ctx, \"dolt\", \"remote\", \"-v\") // #nosec G204 -- fixed command\n\tcmd.Dir = dbPath\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"dolt remote -v failed: %s: %w\", strings.TrimSpace(string(out)), err)\n\t}\n\n\tseen := map[string]bool{}\n\tvar remotes []storage.RemoteInfo\n\tfor _, line := range strings.Split(strings.TrimSpace(string(out)), \"\\n\") {\n\t\tline = strings.TrimSpace(line)\n\t\tif line == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tparts := strings.Fields(line)\n\t\tif len(parts) >= 2 && !seen[parts[0]] {\n\t\t\tseen[parts[0]] = true\n\t\t\tremotes = append(remotes, storage.RemoteInfo{Name: parts[0], URL: parts[1]})\n\t\t}\n\t}\n\treturn remotes, nil\n}\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/doltutil/remotes.go#L106-L142","documentation":"ListCLIRemotes shells out to 'dolt remote -v' in the database directory to enumerate CLI-level remotes. If the subprocess exits non-zero, this error wraps the combined output and the exec error. It means the dolt CLI could not list remotes (or dolt isn't a usable binary there).","triggerScenarios":"Calling ListCLIRemotes/FindCLIRemote when the dolt binary is missing, not executable, the directory is not a valid Dolt database, or the command exceeds the timeout.","commonSituations":"dolt not installed or not on PATH; running in a directory without .dolt; outdated dolt binary; slow spawn hitting the context timeout.","solutions":["Run 'dolt remote -v' manually in dbPath to see the same failure.","Install/upgrade the dolt binary and confirm it is on PATH.","Verify dbPath is a valid Dolt database directory (contains .dolt).","If timeouts occur, check system load or dolt startup latency."],"exampleFix":"// before\ncmd := exec.Command(\"dolt\", \"remote\", \"-v\") // dolt not on PATH\n// after\nif _, err := exec.LookPath(\"dolt\"); err != nil {\n    return nil, fmt.Errorf(\"dolt binary not found: %w\", err)\n}\ncmd := exec.Command(\"dolt\", \"remote\", \"-v\")","handlingStrategy":"fallback","validationCode":"if _, err := exec.LookPath(\"dolt\"); err != nil { return errors.New(\"dolt CLI not installed\") }","typeGuard":null,"tryCatchPattern":"remotes, err := doltutil.ListCLIRemotes(dbPath)\nif err != nil {\n    // fall back to persisted remotes from repo_state.json\n    remotes, err = doltutil.PersistedRemotes(dbPath)\n    if err != nil { return err }\n}","preventionTips":["Install dolt and keep it on PATH (verify: dolt version)","Only call CLI remotes helpers inside a real Dolt database directory","Prefer SQL-level remote management where available","Watch for timeout-prone environments (slow process spawn)"],"tags":["subprocess","dolt","cli","exec"],"backgroundTag":"command-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}