{"record":{"id":"1ba87ef2bf22abc2","repo":"gastownhall/beads","slug":"setting-dolt-user-email-w-s","errorCode":null,"errorMessage":"setting dolt user.email: %w\n%s","messagePattern":"setting dolt user\\.email: %w\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/doltserver/doltserver.go","lineNumber":1886,"sourceCode":"\tgitName := \"beads\"\n\tgitEmail := \"beads@localhost\"\n\n\tif out, err := exec.Command(\"git\", \"config\", \"user.name\").Output(); err == nil {\n\t\tif name := strings.TrimSpace(string(out)); name != \"\" {\n\t\t\tgitName = name\n\t\t}\n\t}\n\tif out, err := exec.Command(\"git\", \"config\", \"user.email\").Output(); err == nil {\n\t\tif email := strings.TrimSpace(string(out)); email != \"\" {\n\t\t\tgitEmail = email\n\t\t}\n\t}\n\n\tif out, err := exec.Command(\"dolt\", \"config\", \"--global\", \"--add\", \"user.name\", gitName).CombinedOutput(); err != nil {\n\t\treturn fmt.Errorf(\"setting dolt user.name: %w\\n%s\", err, out)\n\t}\n\tif out, err := exec.Command(\"dolt\", \"config\", \"--global\", \"--add\", \"user.email\", gitEmail).CombinedOutput(); err != nil {\n\t\treturn fmt.Errorf(\"setting dolt user.email: %w\\n%s\", err, out)\n\t}\n\n\treturn nil\n}\n\n// bdDoltMarker is written after a current bd process creates or acknowledges a\n// local Dolt repository. Its absence in an existing .dolt/ directory indicates\n// the database was created by a pre-0.56 bd version (which used embedded mode).\n// Those databases are incompatible with the current server-only architecture.\nconst bdDoltMarker = \".bd-dolt-ok\"\n\n// MarkDoltDirCompatible writes the canonical bd compatibility marker when\n// doltDir contains a local Dolt repository. It no-ops when there is no .dolt/\n// directory, which lets server and repair paths call it defensively.\nfunc MarkDoltDirCompatible(doltDir string) error {\n\tif doltDir == \"\" {\n\t\treturn errors.New(\"dolt directory is required\")\n\t}","sourceCodeStart":1868,"sourceCodeEnd":1904,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/doltserver/doltserver.go#L1868-L1904","documentation":"bd wraps the failure of the external command `dolt config --global --add user.email <email>` in ensureDoltIdentity (internal/doltserver/doltserver.go:1886). It fires only after setting user.name succeeded (or was attempted), and the message appends dolt's combined output to the exec error. This is the second half of seeding a Dolt committer identity from git config or the beads defaults.","triggerScenarios":"dolt global user.name was unset, bd proceeded past the user.name step, then `dolt config --global --add user.email ...` exits non-zero — typical causes: HOME became unwritable between the two calls, a concurrent process locked/rewrote the global config, disk full, or dolt binary vanished from PATH mid-run.","commonSituations":"Disk quota exceeded on the home volume; parallel bd/dolt processes racing on ~/.dolt/config_global.json; partially corrupted global config after the name write succeeded; CI runners cleaning $HOME mid-job.","solutions":["Read dolt's output appended after the wrapped error — it usually names the exact config-file problem.","Run `dolt config --global --add user.email \"you@example.com\"` manually to reproduce and see the raw error.","Check disk space/quota on $HOME (`df -h $HOME`) and free space if full.","Set both keys explicitly beforehand (`dolt config --global --set user.name ...; dolt config --global --set user.email ...`) so bd skips auto-setup entirely.","If the global config file is corrupt, back it up and delete ~/.dolt/config_global.json, then re-run bd."],"exampleFix":"// before: disk full, bd auto-config fails midway\n$ bd ready\nError: setting dolt user.email: exit status 1: write error: no space left on device\n// after\n$ df -h $HOME          # free space or expand volume\n$ dolt config --global --set user.name \"beads\"\n$ dolt config --global --set user.email \"beads@localhost\"\n$ bd ready","handlingStrategy":"validation","validationCode":"// Ensure disk space and a complete identity before running bd\n[ \"$(df --output=avail -B1 \"$HOME\" | tail -1)\" -gt 104857600 ] || { echo \"insufficient space in $HOME\"; exit 1; }\ndolt config --global --get user.email >/dev/null 2>&1 || dolt config --global --set user.email \"$(git config user.email || echo beads@localhost)\"","typeGuard":null,"tryCatchPattern":"// Catch and surface dolt's appended output to the operator\nif err := run(); err != nil && strings.HasPrefix(err.Error(), \"setting dolt user.email:\") {\n    // err text ends with dolt's combined output; log it verbatim for diagnosis\n    fmt.Fprintln(os.Stderr, \"dolt user.email setup failed:\\n\"+err.Error())\n    os.Exit(1)\n}","preventionTips":["Set both user.name and user.email globally with `dolt config --global --set` ahead of time so bd skips auto-setup.","Monitor disk quota on home volumes where bd/Dolt data lives.","Avoid running concurrent bd/dolt processes against the same $HOME during first-run config.","Treat user.name and user.email as a pair — if one needed seeding, seed both in the same setup step."],"tags":["dolt","config","exec","email","identity"],"backgroundTag":"dolt-config-setup-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}