{"record":{"id":"e5bdb4736f9230a9","repo":"gastownhall/beads","slug":"failed-to-enable-team-mode-w","errorCode":null,"errorMessage":"failed to enable team mode: %w","messagePattern":"failed to enable team mode: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init_team.go","lineNumber":113,"sourceCode":"\n\t\tif err := createSyncBranch(syncBranch); err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"Warning: failed to create sync branch: %v\\n\", err)\n\t\t\tfmt.Println(\"  You can create it manually: git checkout -b\", syncBranch)\n\t\t} else {\n\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\"))","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init_team.go#L95-L131","documentation":"Near the end of the team wizard, bd enables team mode by writing the 'team.enabled=true' config key through store.SetConfig. If that storage write fails, the error is wrapped as 'failed to enable team mode: %w'. Team mode remains off, so sync behavior will not activate.","triggerScenarios":"Running `bd init --team` where SetConfig(\"team.enabled\", \"true\") fails: Dolt store unavailable/closed, write permission denied, database corruption, or connection dropped mid-wizard.","commonSituations":"Dolt server restarted or disconnected during setup; read-only filesystem or no write permission on the DB; earlier partial init left the store in a bad state.","solutions":["Inspect the wrapped cause for the storage-level reason","Confirm the Dolt DB is up and writable (permissions on .beads data directory)","Retry `bd init --team` after restoring DB connectivity; wizard config writes are idempotent","As a manual fallback, set the key directly: bd config set team.enabled true"],"exampleFix":"// manual recovery instead of wizard\n// before: wizard fails with 'failed to enable team mode: ...'\n// after\n$ bd config set team.enabled true\n$ bd config set team.sync_branch beads-metadata","handlingStrategy":"try-catch","validationCode":"if _, err := store.GetConfig(ctx, \"team.enabled\"); 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 enable team mode\") {\n        // storage write failed; fall back to manual config\n        _ = store.SetConfig(context.Background(), \"team.enabled\", \"true\")\n    }\n    return err\n}","preventionTips":["Verify store connectivity before starting team setup","Avoid interrupting the wizard mid-write (use a stable connection)","Set team.enabled via `bd config set` if the wizard keeps failing"],"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"}