{"record":{"id":"0ea460bc3227fe67","repo":"gastownhall/beads","slug":"failed-to-set-team-sync-branch-w","errorCode":null,"errorMessage":"failed to set team sync branch: %w","messagePattern":"failed to set team sync branch: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init_team.go","lineNumber":118,"sourceCode":"\t\t\tfmt.Printf(\"%s Sync branch created\\n\", ui.RenderPass(\"✓\"))\n\t\t}\n\n\t} else {\n\t\tfmt.Printf(\"%s Direct commits to %s\\n\", ui.RenderPass(\"✓\"), currentBranch)\n\t\tsyncBranch = currentBranch\n\t}\n\n\t// Step 3: Configure team settings\n\tfmt.Printf(\"\\n%s Configuring team settings...\\n\", ui.RenderAccent(\"▶\"))\n\n\t// Set team.enabled to true\n\tif err := store.SetConfig(ctx, \"team.enabled\", \"true\"); err != nil {\n\t\treturn fmt.Errorf(\"failed to enable team mode: %w\", err)\n\t}\n\n\t// Set team.sync_branch\n\tif err := store.SetConfig(ctx, \"team.sync_branch\", syncBranch); err != nil {\n\t\treturn fmt.Errorf(\"failed to set team sync branch: %w\", err)\n\t}\n\n\tfmt.Printf(\"%s Team mode enabled\\n\", ui.RenderPass(\"✓\"))\n\n\t// Step 4: Summary\n\tfmt.Printf(\"\\n%s %s\\n\\n\", ui.RenderPass(\"✓\"), ui.RenderBold(\"Team setup complete!\"))\n\n\tfmt.Println(\"Configuration:\")\n\tif protectedMain {\n\t\tfmt.Printf(\"  Protected main: %s\\n\", ui.RenderAccent(\"yes\"))\n\t\tfmt.Printf(\"  Sync branch: %s\\n\", ui.RenderAccent(syncBranch))\n\t\tfmt.Printf(\"  Commits will go to: %s\\n\", ui.RenderAccent(syncBranch))\n\t\tfmt.Printf(\"  Merge to main via: %s\\n\", ui.RenderAccent(\"Pull Request\"))\n\t} else {\n\t\tfmt.Printf(\"  Protected main: %s\\n\", ui.RenderAccent(\"no\"))\n\t\tfmt.Printf(\"  Commits will go to: %s\\n\", ui.RenderAccent(currentBranch))\n\t}\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init_team.go#L100-L136","documentation":"Immediately after enabling team mode, the wizard stores the chosen branch under the 'team.sync_branch' config key. If SetConfig fails, the error is wrapped as 'failed to set team sync branch: %w'. Note team.enabled may already be true, leaving a half-configured state until this is fixed.","triggerScenarios":"Running `bd init --team` where SetConfig(\"team.sync_branch\", syncBranch) fails: Dolt connection lost between the two config writes, permissions/IO error, or DB corruption.","commonSituations":"Transient DB disconnect between the team.enabled and team.sync_branch writes; disk quota exceeded mid-wizard; concurrent process holding a conflicting DB transaction.","solutions":["Fix the underlying storage issue (connectivity/permissions) revealed by the wrapped error","Re-run `bd init --team` — both config writes are idempotent, so a clean retry repairs the partial state","Or finish manually: bd config set team.sync_branch <branch>","Verify with `bd config get team.sync_branch` before using team sync"],"exampleFix":"// before: wizard aborted after team.enabled write\n// after: complete the config manually\n$ bd config set team.sync_branch beads-metadata\n$ bd config get team.sync_branch","handlingStrategy":"fallback","validationCode":"if _, err := store.GetConfig(ctx, \"team.sync_branch\"); err != nil {\n    return fmt.Errorf(\"store not readable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := runTeamWizard(ctx, st); err != nil {\n    if strings.Contains(err.Error(), \"failed to set team sync branch\") {\n        // recover: set the key manually so team mode is not half-configured\n        _ = store.SetConfig(context.Background(), \"team.sync_branch\", \"beads-metadata\")\n    }\n    return err\n}","preventionTips":["After any failed wizard run, verify both team.enabled and team.sync_branch with bd config get","Retry `bd init --team` — writes are idempotent and repair partial state","Keep DB connections alive; do not run the wizard against a flaky remote"],"tags":["storage","config","dolt","team-mode"],"backgroundTag":"config-write-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}