{"record":{"id":"4f4fc26f7cb34461","repo":"gastownhall/beads","slug":"managed-proxied-server-config-w","errorCode":null,"errorMessage":"managed proxied-server config: %w","messagePattern":"managed proxied-server config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init.go","lineNumber":936,"sourceCode":"\t\t\tplannedDBPath = doltserver.DoltDirPath(beadsDirForInit)\n\t\t}\n\n\t\t// Determine if we should create .beads/ directory in CWD or main repo root\n\t\t// For worktrees, .beads should always be in the main repository root\n\t\tcwd, err := os.Getwd()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get current directory: %v\", err)\n\t\t}\n\n\t\thasExplicitBeadsDir := os.Getenv(\"BEADS_DIR\") != \"\"\n\n\t\t// Use the beadsDir computed earlier (before any directory creation)\n\t\t// to ensure consistent path representation.\n\t\tbeadsDir := beadsDirForInit\n\n\t\tif initProxiedServer && externalConfig == nil {\n\t\t\tif err := validateManagedProxiedServerConfigAtInit(beadsDir, serverConfigPath, serverRootPath); err != nil {\n\t\t\t\treturn fmt.Errorf(\"managed proxied-server config: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\t// Prevent nested .beads directories\n\t\t// Check if current working directory is inside a .beads directory\n\t\tif strings.Contains(filepath.Clean(cwd), string(filepath.Separator)+\".beads\"+string(filepath.Separator)) ||\n\t\t\tstrings.HasSuffix(filepath.Clean(cwd), string(filepath.Separator)+\".beads\") {\n\t\t\tfmt.Fprintf(os.Stderr, \"Error: cannot initialize bd inside a .beads directory\\n\")\n\t\t\tfmt.Fprintf(os.Stderr, \"Current directory: %s\\n\", cwd)\n\t\t\tfmt.Fprintf(os.Stderr, \"Please run 'bd init' from outside the .beads directory.\\n\")\n\t\t\treturn &exitError{Code: 1}\n\t\t}\n\n\t\t// Convert the workspace to an absolute path before gate planning.\n\t\tbeadsDirAbs, err := filepath.Abs(beadsDir)\n\t\tif err != nil {\n\t\t\tbeadsDirAbs = filepath.Clean(beadsDir)\n\t\t}","sourceCodeStart":918,"sourceCodeEnd":954,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init.go#L918-L954","documentation":"For proxied-server inits, bd validates the managed proxied-server configuration before touching the filesystem. If validation of the beads-dir config (serverConfigPath/serverRootPath) fails, init aborts with 'managed proxied-server config' wrapping the cause.","triggerScenarios":"`bd init` with the proxied-server flag active (initProxiedServer) and no external config supplied, where validateManagedProxiedServerConfigAtInit fails — e.g. missing or invalid managed server config at the expected path.","commonSituations":"Hand-edited managed server config with a missing field; config path moved after a version upgrade; leftover stale config from a prior proxied-server run.","solutions":["Read the wrapped cause in the error to find the specific config problem","Restore/repair the managed server config at the path bd reports, or delete it to regenerate","If you use an external config, make sure it is actually detected (externalConfig != nil)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"test -f \"$(bd config path 2>/dev/null)/server.yaml\" || echo \"managed server config missing\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not hand-edit managed proxied-server config; regenerate via bd commands","After upgrading bd, re-run init/doctor to refresh managed config","Track server config paths in a single documented location for your team"],"tags":["cli","proxied-server","configuration"],"backgroundTag":"proxied-server-config-invalid","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}