{"record":{"id":"e4f60420c051a35b","repo":"gastownhall/beads","slug":"s-set-via-s-but-server-mode-is-not-enabled-em","errorCode":null,"errorMessage":"%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.","messagePattern":"(.+?) set via (.+?) but server mode is not enabled\\.\n  Embedded mode has no host/port — these settings require server mode\\.\n  Set dolt\\.mode: server in (.+?) or pass --server to bd init\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init.go","lineNumber":744,"sourceCode":"\t\t\treturn fmt.Errorf(\"database name %q contains hyphens which are invalid in embedded mode; use underscores instead (e.g. %q)\",\n\t\t\t\tdatabase, sanitizeDBName(database))\n\t\t}\n\n\t\t// Hard fail: if a remote dolt.host is configured, server mode MUST\n\t\t// be active — embedded mode has no host. dolt.port alone is ambient\n\t\t// plumbing (e.g. test harnesses) and is not treated as server intent.\n\t\tif !initServerMode {\n\t\t\tconfigHost := config.GetYamlConfig(\"dolt.host\")\n\t\t\tenvHost := os.Getenv(\"BEADS_DOLT_SERVER_HOST\")\n\t\t\tconfigPort := config.GetYamlConfig(\"dolt.port\")\n\t\t\tenvPort := os.Getenv(\"BEADS_DOLT_SERVER_PORT\")\n\n\t\t\tif conflict := detectInitRemoteHostConflict(configHost, envHost, configPort, envPort); conflict != nil {\n\t\t\t\tdetail := fmt.Sprintf(\"dolt.host (%s) is\", conflict.host)\n\t\t\t\tif conflict.includesPort {\n\t\t\t\t\tdetail = fmt.Sprintf(\"dolt.host (%s) and dolt.port are\", conflict.host)\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"%s set via %s but server mode is not enabled.\\n\"+\n\t\t\t\t\t\"  Embedded mode has no host/port — these settings require server mode.\\n\"+\n\t\t\t\t\t\"  Set dolt.mode: server in %s or pass --server to bd init.\",\n\t\t\t\t\tdetail, conflict.source, config.UserConfigYamlDisplayPath())\n\t\t\t}\n\t\t}\n\n\t\t// Historical workspaces need an explicit sealed-copy bridge. This runs\n\t\t// before init's existing-workspace checks so even --force cannot create\n\t\t// or rewrite state beside a source that has not been preserved.\n\t\tif beadsDir := resolveInitBeadsDir(); beadsDir != \"\" {\n\t\t\tif err := guardLegacyUpgradeWorkspace(beadsDir); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\t// Safety guard: check for existing beads data.\n\t\t// This prevents accidental re-initialization. --force and\n\t\t// --reinit-local both bypass this local-only guard; they do NOT","sourceCodeStart":726,"sourceCodeEnd":762,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init.go#L726-L762","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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"],"exampleFix":"// before (config yaml)\ndolt:\n  host: 127.0.0.1\n// after\ndolt:\n  mode: server\n  host: 127.0.0.1","handlingStrategy":"validation","validationCode":"grep -E '^(dolt:|\\s+host:|\\s+port:)' .beads/config.yaml  # ensure no host/port unless mode: server is set","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["cli","configuration","server-mode","embedded-mode"],"backgroundTag":"host-config-without-server-mode","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}