{"record":{"id":"d480fad0ce62f985","repo":"gastownhall/beads","slug":"persist-sync-remote-to-config-yaml-w","errorCode":null,"errorMessage":"persist sync.remote to config.yaml: %w","messagePattern":"persist sync\\.remote to config\\.yaml: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/bootstrap.go","lineNumber":849,"sourceCode":"\t\tcfg.Database = \"dolt\"\n\t}\n\n\tif err := cfg.Save(beadsDir); err != nil {\n\t\treturn fmt.Errorf(\"write metadata.json: %w\", err)\n\t}\n\n\tif err := createConfigYaml(beadsDir, false, \"\"); err != nil {\n\t\treturn fmt.Errorf(\"create config.yaml: %w\", err)\n\t}\n\tif err := doctor.EnsureGitignoreForBeadsDir(beadsDir); err != nil {\n\t\treturn fmt.Errorf(\"ensure .beads/.gitignore: %w\", err)\n\t}\n\n\t// Persist sync.remote so subsequent fresh clones (and bd bootstrap\n\t// retries) can rediscover the remote without re-probing origin refs.\n\tif syncRemote != \"\" {\n\t\tif err := config.SetYamlConfigInDir(beadsDir, \"sync.remote\", syncRemote); err != nil {\n\t\t\treturn fmt.Errorf(\"persist sync.remote to config.yaml: %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype remoteCloneMode int\n\nconst (\n\tremoteCloneAuto remoteCloneMode = iota\n\tremoteCloneEmbedded\n\tremoteCloneExternalServer\n\tremoteCloneCLI\n)\n\n// cloneFromRemote clones a Dolt database from a remote URL.\n// In embedded mode, uses the embedded engine's DOLT_CLONE procedure.\n// In external server mode, connects to the running server via MySQL and","sourceCodeStart":831,"sourceCodeEnd":867,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/bootstrap.go#L831-L867","documentation":"Wrapped by finalizeSyncedBootstrap in cmd/bd/bootstrap.go:849 when config.SetYamlConfigInDir fails to persist sync.remote into .beads/config.yaml. This key lets later fresh clones and bootstrap retries rediscover the remote without probing origin refs, so failure to write it leaves the workspace without recorded remote state. The wrapped error is a YAML read/write failure in the .beads directory.","triggerScenarios":"bd bootstrap calls finalizeSyncedBootstrap with a non-empty syncRemote and SetYamlConfigInDir fails due to unparseable existing config.yaml, unwritable directory, or config.yaml existing as a directory.","commonSituations":"A hand-edited config.yaml with invalid YAML syntax; permissions changed by another tool; a version mismatch where config.yaml was written by a newer bd with unsupported syntax.","solutions":["Validate/fix YAML syntax in .beads/config.yaml (run a YAML parser over it or restore from git)","Fix write permissions on .beads and config.yaml","Delete a malformed config.yaml and re-run bd bootstrap (createConfigYaml will recreate it)","Upgrade/downgrade bd so the config.yaml version matches what you are running"],"exampleFix":"// before: hand-edited config.yaml with a tab character -> yaml parse error\n// after\n$ bd bootstrap\n// error: persist sync.remote to config.yaml: yaml: found character that cannot start any token\n$ git checkout -- .beads/config.yaml  # or fix the tab\n$ bd bootstrap","handlingStrategy":"validation","validationCode":"// validate config.yaml parses before bootstrap\nimport \"gopkg.in/yaml.v3\"\nfunc validYAML(path string) error {\n\tb, err := os.ReadFile(path)\n\tif err != nil { return err }\n\tvar m map[string]any\n\treturn yaml.Unmarshal(b, &m)\n}","typeGuard":null,"tryCatchPattern":"if err := finalize(); err != nil {\n\tif strings.Contains(err.Error(), \"persist sync.remote\") {\n\t\t// restore config.yaml from git or delete it and re-run bootstrap\n\t}\n}","preventionTips":["Never hand-edit .beads/config.yaml with editors that insert tabs; use bd config commands","Commit config.yaml so a bad local edit can be reverted via git","Avoid running multiple bd processes that write config concurrently","Keep bd versions consistent across machines to avoid config schema drift"],"tags":["yaml","config","persistence"],"backgroundTag":"yaml-parse-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}