gastownhall/beads · error
invalid --dolt-auto-commit=%q (valid: off, on, batch)
Error message
invalid --dolt-auto-commit=%q (valid: off, on, batch)
What it means
getDoltAutoCommitMode validates the --dolt-auto-commit flag value and rejects anything other than the three allowed modes: off, on, or batch. This is pure input validation: the flag string did not match any known mode constant. The error names the invalid value and the valid options so the user can correct the command line.
Source
Thrown at cmd/bd/dolt_autocommit_config.go:31
doltAutoCommitBatch doltAutoCommitMode = "batch"
)
func getDoltAutoCommitMode() (doltAutoCommitMode, error) {
mode := strings.TrimSpace(strings.ToLower(doltAutoCommit))
if mode == "" {
// Default resolved at store-creation time in main.go based on server mode.
// If still empty here, fall back to off (safe default).
mode = string(doltAutoCommitOff)
}
switch doltAutoCommitMode(mode) {
case doltAutoCommitOff:
return doltAutoCommitOff, nil
case doltAutoCommitOn:
return doltAutoCommitOn, nil
case doltAutoCommitBatch:
return doltAutoCommitBatch, nil
default:
return "", fmt.Errorf("invalid --dolt-auto-commit=%q (valid: off, on, batch)", doltAutoCommit)
}
}
View on GitHub (pinned to 71377f2769)
Solutions
- Use one of exactly off, on, or batch (lowercase) for --dolt-auto-commit
- Check the script/CI config for typos or stray whitespace in the flag value
- Run bd dolt --help (or the wrapping command's help) to confirm accepted values
Example fix
// before bd push --dolt-auto-commit=auto // after bd push --dolt-auto-commit=batch
Defensive patterns
Strategy: validation
Validate before calling
func validAutoCommit(v string) bool {
switch v { case "off", "on", "batch": return true }
return false
}
if !validAutoCommit(flagVal) { return fmt.Errorf("invalid --dolt-auto-commit=%q (valid: off, on, batch)", flagVal) } Prevention
- Only use the literal strings off, on, batch (lowercase) in scripts and CI
- Centralize flag values in a config constant rather than hand-writing them per job
- Validate config files at startup with the same mode constants
When it happens
Trigger: Passing --dolt-auto-commit with a misspelled or unsupported value, e.g. --dolt-auto-commit=auto, --dolt-auto-commit=OFF (case-sensitive), or an empty string from an env/config source feeding the flag.
Common situations: Typo in scripts or CI pipelines; copy-pasting config from older bd versions where different mode names existed; setting BD_DOLT_AUTO_COMMIT-like env values with wrong casing.
Related errors
- cannot specify both --reason-file and --reason/--resolution/
- --server-host cannot be empty; omit the flag to use BEADS_DO
- --server-user cannot be empty; omit the flag to use BEADS_DO
- invalid remote name: %w
- invalid remote URL: %w
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/e32305ab4198597f.
Report an issue: GitHub.