{"record":{"id":"e9677468001adbb4","repo":"gastownhall/beads","slug":"sync-from-remote-w","errorCode":null,"errorMessage":"sync from remote: %w","messagePattern":"sync from remote: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/bootstrap.go","lineNumber":1010,"sourceCode":"\t\t\treturn port\n\t\t}\n\t}\n\tif resolved := doltserver.DefaultConfig(beadsDir); resolved.Port > 0 {\n\t\treturn resolved.Port\n\t}\n\tif cfg != nil {\n\t\treturn cfg.GetDoltServerPort()\n\t}\n\treturn configfile.DefaultDoltServerPort\n}\n\n// cloneViaCLI clones by shelling out to the dolt CLI.\n// Used for owned-server mode where bd manages the server lifecycle.\nfunc cloneViaCLI(ctx context.Context, beadsDir, remoteURL, dbName string) error {\n\tdoltDir := doltserver.ResolveDoltDir(beadsDir)\n\tsynced, err := dolt.BootstrapFromRemoteWithDB(ctx, doltDir, remoteURL, dbName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"sync from remote: %w\", err)\n\t}\n\tif synced {\n\t\tfmt.Fprintf(os.Stderr, \"Synced database from %s\\n\", remoteURL)\n\t}\n\treturn nil\n}\n\nfunc inferPrefix(cfg *configfile.Config) string {\n\tdb := cfg.GetDoltDatabase()\n\tif db != \"\" && db != \"beads\" {\n\t\treturn db\n\t}\n\tcwd, _ := os.Getwd()\n\treturn filepath.Base(cwd)\n}\n\n// isNonInteractiveBootstrap returns true if bootstrap should skip confirmation prompts.\n// Precedence: explicit flag > BD_NON_INTERACTIVE env > CI env > terminal detection.","sourceCodeStart":992,"sourceCodeEnd":1028,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/bootstrap.go#L992-L1028","documentation":"Wrapped by cloneViaCLI in cmd/bd/bootstrap.go:1010 when dolt.BootstrapFromRemoteWithDB fails. This path shells out to the dolt CLI (used in owned-server mode where bd manages the server lifecycle) to sync the database into the resolved .beads dolt directory. Failure means the dolt CLI clone/pull of the named database from the remote did not succeed.","triggerScenarios":"cloneFromRemoteWithMode falls through to cloneViaCLI (default/owned-server mode, or server mode with no config) and BootstrapFromRemoteWithDB errors: dolt binary not installed or wrong version on PATH, remote URL invalid/unreachable, auth failure, or pre-existing conflicting data directory.","commonSituations":"dolt CLI not installed (`command not found` wrapped in the error); outdated dolt version incompatible with the remote's storage format; wrong remote URL; corporate proxy blocking doltremoteapi; corrupted existing .beads/dolt directory from an interrupted clone.","solutions":["Install or fix the dolt CLI: verify `dolt version` on PATH and upgrade to a current release","Test the remote manually: `dolt clone <remoteURL>` in a temp dir to surface the real cause (auth/DNS/URL)","Set correct Dolt credentials (dolt config --global user.email / remote credentials) and DOLT_REMOTE_USER if needed","If .beads/dolt is corrupted from a partial clone, remove it and re-run bd bootstrap"],"exampleFix":"// before\n$ bd bootstrap\n// error: sync from remote: exec: \"dolt\": executable file not found in $PATH\n// after\n$ brew install dolt   # or download from dolthub\n$ dolt version && bd bootstrap","handlingStrategy":"validation","validationCode":"// verify dolt CLI availability and remote before bootstrap\nif _, err := exec.LookPath(\"dolt\"); err != nil {\n\treturn fmt.Errorf(\"dolt CLI required for CLI clone mode: %w\", err)\n}\nout, err := exec.Command(\"dolt\", \"version\").CombinedOutput()\n_ = out\n_ = err","typeGuard":null,"tryCatchPattern":"err := cloneViaCLI(ctx, dir, url, db)\nif err != nil && strings.Contains(err.Error(), \"sync from remote\") {\n\t// run `dolt clone <url>` manually to see the underlying cause\n\t// fix PATH/auth/URL, clear a corrupted .beads/dolt, and retry\n}","preventionTips":["Install the dolt CLI and keep it on PATH for all machines using CLI/owned-server clone mode","Keep dolt version reasonably current to match remote storage formats","Verify remote URLs and credentials with a manual `dolt clone` before scripted runs","Never delete or partially modify .beads/dolt mid-clone; re-run bootstrap to recover"],"tags":["dolt-cli","remote-sync","bootstrap"],"backgroundTag":"dolt-remote-clone-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}