{"record":{"id":"c86babd10c6b2a93","repo":"gastownhall/beads","slug":"clone-from-remote-w","errorCode":null,"errorMessage":"clone from remote: %w","messagePattern":"clone from remote: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/bootstrap.go","lineNumber":937,"sourceCode":"\tdefault:\n\t\treturn remoteCloneCLI\n\t}\n}\n\n// cloneViaEmbedded clones using the embedded Dolt engine (CGO required).\nfunc cloneViaEmbedded(ctx context.Context, beadsDir, remoteURL, dbName string) error {\n\tdataDir := filepath.Join(beadsDir, \"embeddeddolt\")\n\tif err := os.MkdirAll(dataDir, 0o750); err != nil {\n\t\treturn fmt.Errorf(\"create embeddeddolt directory: %w\", err)\n\t}\n\tdb, cleanup, err := embeddeddolt.OpenSQL(ctx, dataDir, \"\", \"\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"open embedded engine for clone: %w\", err)\n\t}\n\tdefer func() { _ = cleanup() }()\n\n\tif err := versioncontrolops.DoltClone(ctx, db, remoteURL, dbName, os.Getenv(\"DOLT_REMOTE_USER\")); err != nil {\n\t\treturn fmt.Errorf(\"clone from remote: %w\", err)\n\t}\n\tfmt.Fprintf(os.Stderr, \"Synced database from %s\\n\", remoteURL)\n\treturn nil\n}\n\n// cloneViaServer clones by connecting to the external Dolt server and\n// executing CALL DOLT_CLONE. The server places the database in its own\n// data directory, which is the correct behavior for externally managed\n// servers where bd does not know the filesystem layout.\nfunc cloneViaServer(ctx context.Context, beadsDir, remoteURL, dbName string, cfg *configfile.Config) error {\n\tport := serverClonePort(beadsDir, cfg)\n\tdsn := doltutil.ServerDSN{\n\t\tSocket:   cfg.GetDoltServerSocket(),\n\t\tHost:     cfg.GetDoltServerHost(),\n\t\tPort:     port,\n\t\tUser:     cfg.GetDoltServerUser(),\n\t\tPassword: cfg.GetDoltServerPasswordForPort(port),\n\t\tTLS:      cfg.GetDoltServerTLS(),","sourceCodeStart":919,"sourceCodeEnd":955,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/bootstrap.go#L919-L955","documentation":"Wrapped by cloneViaEmbedded in cmd/bd/bootstrap.go:937 when versioncontrolops.DoltClone fails to run CALL DOLT_CLONE against the remote URL using the embedded SQL engine. The engine started fine; the actual remote clone (network, auth, or remote existence) failed.","triggerScenarios":"DoltClone(ctx, db, remoteURL, dbName, DOLT_REMOTE_USER) returns an error: remote URL unreachable/DNS failure, authentication rejected (bad DOLT_REMOTE_USER / credentials), remote database does not exist, or the clone timed out on a large database.","commonSituations":"Wrong remote URL typed into bd init --remote; expired or missing Dolt remote credentials; private repo without auth; corporate proxy blocking doltremoteapi.dolthub.com; transient network drop.","solutions":["Verify the remote URL (dolt ls-commits or curl it / try `dolt clone <url>` manually with the dolt CLI)","Set correct credentials: export DOLT_REMOTE_USER and ensure ~/.dolt credentials match the remote account","Confirm the remote database/org name exists and your user has read access","Check network/proxy access to doltremoteapi.dolthub.com and retry (clone is safe to re-run)"],"exampleFix":"// before: no credentials for private remote\n$ bd bootstrap\n// error: clone from remote: unable to authenticate\n// after\n$ dolt config --global --add user.email you@example.com\n$ export DOLT_REMOTE_USER=you\n$ dolt clone https://doltremoteapi.dolthub.com/org/beads  # verify access\n$ bd bootstrap","handlingStrategy":"retry","validationCode":"// verify remote reachability before clone\nurl := \"https://doltremoteapi.dolthub.com/org/beads\"\nresp, err := http.Head(url)\nif err != nil || resp.StatusCode >= 500 { /* fix network/auth first */ }\nif os.Getenv(\"DOLT_REMOTE_USER\") == \"\" { /* set credentials for private remotes */ }","typeGuard":null,"tryCatchPattern":"err := cloneViaEmbedded(ctx, dir, remoteURL, dbName)\nif err != nil && strings.Contains(err.Error(), \"clone from remote\") {\n\t// check credentials/network, then retry — clone is idempotent on failure\n\ttime.Sleep(2 * time.Second)\n\terr = cloneViaEmbedded(ctx, dir, remoteURL, dbName)\n}","preventionTips":["Verify the remote URL with a manual `dolt clone` before scripting bd bootstrap","Keep Dolt credentials current (dolt config --global) and set DOLT_REMOTE_USER for private remotes","Check corporate proxy/firewall allows doltremoteapi.dolthub.com","Confirm the database/org name exists on DoltHub before initializing"],"tags":["network","dolt-clone","authentication"],"backgroundTag":"dolt-remote-clone-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}