{"record":{"id":"0a15b8d4ce739184","repo":"gastownhall/beads","slug":"failed-to-configure-hydration-w","errorCode":null,"errorMessage":"failed to configure hydration: %w","messagePattern":"failed to configure hydration: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init_contributor.go","lineNumber":231,"sourceCode":"\t\treturn fmt.Errorf(\"failed to set routing contributor path: %w\", err)\n\t}\n\n\tfmt.Printf(\"%s Auto-routing enabled\\n\", ui.RenderPass(\"✓\"))\n\n\t// Step 4b: Enable multi-repo hydration so routed issues are visible (bd-fix-routing)\n\tfmt.Printf(\"\\n%s Configuring multi-repo hydration...\\n\", ui.RenderAccent(\"▶\"))\n\n\t// Find config.yaml path\n\tconfigPath, err := config.FindConfigYAMLPath()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to find config.yaml: %w\", err)\n\t}\n\n\t// Add planning repo to repos.additional for hydration\n\tif err := config.AddRepo(configPath, planningPath); err != nil {\n\t\t// Check if already added (non-fatal)\n\t\tif !strings.Contains(err.Error(), \"already exists\") {\n\t\t\treturn fmt.Errorf(\"failed to configure hydration: %w\", err)\n\t\t}\n\t}\n\n\tfmt.Printf(\"%s Hydration enabled for planning repo\\n\", ui.RenderPass(\"✓\"))\n\tfmt.Println(\"  Issues from planning repo will appear in 'bd list'\")\n\n\t// If this is a fork, configure sync to pull beads from upstream (bd-bx9)\n\t// This ensures `bd dolt pull` gets the latest issues from the source repo,\n\t// not from the fork's potentially outdated origin/main\n\tif isFork {\n\t\tif err := store.SetConfig(ctx, \"sync.remote\", \"upstream\"); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to set sync remote: %w\", err)\n\t\t}\n\t\tfmt.Printf(\"%s Sync configured to pull from upstream (source repo)\\n\", ui.RenderPass(\"✓\"))\n\t}\n\n\t// Step 5: Summary\n\tfmt.Printf(\"\\n%s %s\\n\\n\", ui.RenderPass(\"✓\"), ui.RenderBold(\"Contributor setup complete!\"))","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init_contributor.go#L213-L249","documentation":"Wraps an error from config.AddRepo(configPath, planningPath) when adding the planning repo to repos.additional for multi-repo hydration. Errors containing 'already exists' are treated as non-fatal and swallowed; any other failure (unreadable/unwritable config.yaml, malformed YAML, I/O error) is wrapped and returned.","triggerScenarios":"config.AddRepo fails with a non-'already exists' error inside runContributorWizard — e.g. config.yaml is unreadable, invalid YAML, read-only, or the write-back fails.","commonSituations":"Hand-edited config.yaml with YAML syntax errors; config.yaml owned by root after a sudo run; disk full; schema drift after a beads version change altered the config format.","solutions":["Validate/fix the YAML in the config.yaml reported by the wrapped error (bd doctor or a YAML linter)","Fix file permissions (e.g. chown back to your user if a sudo run changed ownership)","Back up and regenerate config.yaml (bd init) if the schema is outdated","Retry bd init --contributor after the config file is valid and writable"],"exampleFix":"// before — config.yaml with broken indentation\nrepos:\nadditional:\n  - ~/.beads-planning\n// after\nrepos:\n  additional:\n    - ~/.beads-planning","handlingStrategy":"validation","validationCode":"// Validate config.yaml parses before adding repos\ndata, err := os.ReadFile(configPath)\nif err == nil {\n\tvar cfg map[string]any\n\tif err := yaml.Unmarshal(data, &cfg); err != nil {\n\t\treturn fmt.Errorf(\"config.yaml is invalid YAML, fix before setup: %w\", err)\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := runContributorWizard(ctx, store, ...); err != nil {\n\tif strings.Contains(err.Error(), \"failed to configure hydration\") && !strings.Contains(err.Error(), \"already exists\") {\n\t\tfmt.Fprintln(os.Stderr, \"Check config.yaml validity and permissions, then retry\")\n\t}\n\treturn err\n}","preventionTips":["Lint config.yaml after hand edits","Avoid sudo runs that leave config.yaml root-owned","Back up config.yaml before beads version upgrades","Check disk space and file writability before setup"],"tags":["go","config","yaml","cli-setup"],"backgroundTag":"yaml-config-invalid","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}