{"record":{"id":"df53d0b11dcd4594","repo":"gastownhall/beads","slug":"ensureproxiedserverconfig-custom-config-s-not-a","errorCode":null,"errorMessage":"ensureProxiedServerConfig: custom config %s: not a regular file","messagePattern":"ensureProxiedServerConfig: custom config (.+?): not a regular file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/proxied_server.go","lineNumber":131,"sourceCode":"\tif err := validateProxiedServerConfig(path); err != nil {\n\t\treturn \"\", fmt.Errorf(\"ensureProxiedServerConfig: %w\", err)\n\t}\n\treturn path, nil\n}\n\nfunc resolveOrCreateProxiedServerConfig(beadsDir string) (string, error) {\n\tpath, isCustom, err := resolveProxiedServerConfigPath(beadsDir)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif isCustom {\n\t\tinfo, err := os.Stat(path)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"ensureProxiedServerConfig: custom config %s: %w\", path, err)\n\t\t}\n\t\tif !info.Mode().IsRegular() {\n\t\t\treturn \"\", fmt.Errorf(\"ensureProxiedServerConfig: custom config %s: not a regular file\", path)\n\t\t}\n\t\treturn path, nil\n\t}\n\n\troot := filepath.Dir(path)\n\tif err := os.MkdirAll(root, config.BeadsDirPerm); err != nil {\n\t\treturn \"\", fmt.Errorf(\"ensureProxiedServerConfig: mkdir %s: %w\", root, err)\n\t}\n\n\tswitch _, err := os.Stat(path); {\n\tcase err == nil:\n\t\treturn path, nil\n\tcase !os.IsNotExist(err):\n\t\treturn \"\", fmt.Errorf(\"ensureProxiedServerConfig: stat %s: %w\", path, err)\n\t}\n\n\tport, err := proxy.PickFreePort()\n\tif err != nil {","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/proxied_server.go#L113-L149","documentation":"ensureProxiedServerConfig validates a user-supplied (custom) server config path before the proxied daemon uses it. After os.Stat succeeds, it checks that the path is a regular file; directories, sockets, FIFOs, and device nodes are rejected because the config must be readable YAML at a plain file path. This guards the proxy against silently treating a directory or special file as its configuration.","triggerScenarios":"Running `bd` with a custom proxied-server config path (--config or env-provided) that points at a directory, a Unix socket, /dev/null, a named pipe, or any non-regular filesystem entry.","commonSituations":"Passing a directory instead of a file (e.g. `~/.beads` instead of `~/.beads/proxied-server.yaml`); pointing the config at a socket path used by another tool; copy-pasting a path with a trailing slash; using /dev/null to 'disable' config.","solutions":["Verify the path is the intended YAML config file, not a directory or special file: run `ls -la <path>` and confirm it is a regular file (`-` in the first column of ls output).","If the file does not exist yet, create it as a regular file (e.g. `touch ~/.beads/proxied-server.yaml`) or let bd generate a default config by not passing a custom path.","Remove a mistakenly created directory/socket at that path (`rm -rf <path>` if it is a directory you made in error) and recreate as a file.","If the path intentionally points elsewhere, pass the correct file path to the bd command or fix the environment variable / config source supplying it."],"exampleFix":"// before\n$ bd serve --config ~/.beads/            # directory, not a file\n// after\n$ bd serve --config ~/.beads/proxied-server.yaml","handlingStrategy":"validation","validationCode":"info, err := os.Stat(cfgPath)\nif err != nil {\n\treturn fmt.Errorf(\"config path %s: %w\", cfgPath, err)\n}\nif !info.Mode().IsRegular() {\n\treturn fmt.Errorf(\"config path %s is not a regular file\", cfgPath)\n}","typeGuard":"func isRegularFile(path string) bool {\n\tinfo, err := os.Stat(path)\n\treturn err == nil && info.Mode().IsRegular()\n}","tryCatchPattern":null,"preventionTips":["Always pass a full YAML file path, never a directory, when setting a custom bd config path.","Avoid trailing slashes in config paths — they turn files into directory references.","Never point config paths at sockets, FIFOs, or /dev nodes.","Add a preflight `test -f \"$CFG\"` in wrapper scripts before invoking bd with a custom config."],"tags":["go","config","filesystem","proxied-server"],"backgroundTag":"invalid-config-file-path","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}