gastownhall/beads · error
%s set via %s but server mode is not enabled. Embedded mod
Error message
%s set via %s but server mode is not enabled. Embedded mode has no host/port — these settings require server mode. Set dolt.mode: server in %s or pass --server to bd init.
What it means
bd init detects that dolt.host (and possibly dolt.port) is set via config file or environment variables, but the init is not running in server mode. Embedded mode has no host/port to bind, so these settings would silently do nothing — bd treats that inconsistency as a hard error and tells you how to enable server mode.
Source
Thrown at cmd/bd/init.go:744
return fmt.Errorf("database name %q contains hyphens which are invalid in embedded mode; use underscores instead (e.g. %q)",
database, sanitizeDBName(database))
}
// Hard fail: if a remote dolt.host is configured, server mode MUST
// be active — embedded mode has no host. dolt.port alone is ambient
// plumbing (e.g. test harnesses) and is not treated as server intent.
if !initServerMode {
configHost := config.GetYamlConfig("dolt.host")
envHost := os.Getenv("BEADS_DOLT_SERVER_HOST")
configPort := config.GetYamlConfig("dolt.port")
envPort := os.Getenv("BEADS_DOLT_SERVER_PORT")
if conflict := detectInitRemoteHostConflict(configHost, envHost, configPort, envPort); conflict != nil {
detail := fmt.Sprintf("dolt.host (%s) is", conflict.host)
if conflict.includesPort {
detail = fmt.Sprintf("dolt.host (%s) and dolt.port are", conflict.host)
}
return fmt.Errorf("%s set via %s but server mode is not enabled.\n"+
" Embedded mode has no host/port — these settings require server mode.\n"+
" Set dolt.mode: server in %s or pass --server to bd init.",
detail, conflict.source, config.UserConfigYamlDisplayPath())
}
}
// Historical workspaces need an explicit sealed-copy bridge. This runs
// before init's existing-workspace checks so even --force cannot create
// or rewrite state beside a source that has not been preserved.
if beadsDir := resolveInitBeadsDir(); beadsDir != "" {
if err := guardLegacyUpgradeWorkspace(beadsDir); err != nil {
return err
}
}
// Safety guard: check for existing beads data.
// This prevents accidental re-initialization. --force and
// --reinit-local both bypass this local-only guard; they do NOTView on GitHub (pinned to 71377f2769)
Solutions
- Enable server mode: set dolt.mode: server in the config YAML
- Or run bd init --server once
- Or remove the dolt.host/dolt.port settings (and unset the env vars) if you intend to stay in embedded mode
Example fix
// before (config yaml) dolt: host: 127.0.0.1 // after dolt: mode: server host: 127.0.0.1
Defensive patterns
Strategy: validation
Validate before calling
grep -E '^(dolt:|\s+host:|\s+port:)' .beads/config.yaml # ensure no host/port unless mode: server is set
Prevention
- Never export BEADS_DOLT_HOST globally in shell profiles; scope it to server tasks
- Add dolt.mode: server alongside host/port settings in committed configs
- Audit CI scripts for lingering server-mode env vars before embedded init
When it happens
Trigger: `bd init` with dolt.host/dolt.port set in config YAML or via env vars (e.g. BEADS_DOLT_HOST) while server mode is disabled: no dolt.mode: server, no --server flag. detectInitRemoteHostConflict returns a non-nil conflict in this state.
Common situations: Users who previously ran a dolt server leaving host config behind; copying a server-mode config into an embedded workspace; shell profiles exporting BEADS_DOLT_HOST globally.
Related errors
- 'bd admin %s' is not yet supported in embedded mode
- --server and --proxied-server are mutually exclusive
- database name %q contains hyphens which are invalid in embed
- managed proxied-server config: %w
- cannot use -C directory %q: no beads project found
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/e4f60420c051a35b.
Report an issue: GitHub.