{"record":{"id":"cd5eb4c5dfb3a6a2","repo":"gastownhall/beads","slug":"newexternalproxiedserveruowprovider-mkdir-s-w","errorCode":null,"errorMessage":"newExternalProxiedServerUOWProvider: mkdir %s: %w","messagePattern":"newExternalProxiedServerUOWProvider: mkdir (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/uow_factory.go","lineNumber":450,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"newExternalProxiedServerUOWProvider: resolve root path: %w\", err)\n\t}\n\tif err := validateProxiedServerRootPath(rootPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"newExternalProxiedServerUOWProvider: proxied server root (from env or %s): %w\", configfile.ProxiedServerClientInfoFileName, err)\n\t}\n\n\tlogPath, isCustomLog, err := resolveProxiedServerLogPath(beadsDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"newExternalProxiedServerUOWProvider: resolve log path: %w\", err)\n\t}\n\tif isCustomLog {\n\t\tif err := validateProxiedServerLogPath(logPath); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"newExternalProxiedServerUOWProvider: proxied server log (from env or %s): %w\", configfile.ProxiedServerClientInfoFileName, err)\n\t\t}\n\t}\n\n\tif err := os.MkdirAll(rootPath, config.BeadsDirPerm); err != nil {\n\t\treturn nil, fmt.Errorf(\"newExternalProxiedServerUOWProvider: mkdir %s: %w\", rootPath, err)\n\t}\n\n\treturn uow.NewExternalDoltServerUOWProvider(\n\t\tctx,\n\t\trootPath,\n\t\ttopology.database,\n\t\tlogPath,\n\t\t*topology.external,\n\t\ttopology.external.ResolvedUser(),\n\t\ttopology.rootPassword,\n\t\ttopology.proxyPort,\n\t\ttopology.proxyIdle,\n\t\ttopology.teamServer,\n\t\ttopology.expectedProjectID,\n\t\topts...,\n\t)\n}\n","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/uow_factory.go#L432-L468","documentation":"newExternalProxiedServerUOWProvider creates the validated server root directory with os.MkdirAll(rootPath, config.BeadsDirPerm) before constructing the provider; if that mkdir fails the error is wrapped with this message including the root path. Typical causes are filesystem-level problems: missing parent directories that cannot be created, permission denied, read-only filesystem, or the path being occupied by a non-directory that validation somehow passed (e.g. raced deletion) or ENOSPC.","triggerScenarios":"Parent of rootPath does not exist and a component of the path is unwritable; the filesystem holding rootPath is read-only or full; a permission/ACL/SELinux policy denies directory creation; rootPath sits on a removed mount point.","commonSituations":"BEADS_PROXIED_SERVER_ROOT_PATH points into /usr, /etc, or another root-owned tree; container running with a read-only rootfs; disk quota exceeded on the volume hosting ~/.beads or a custom root.","solutions":["Check disk space and writability: df -h on the root path's volume, and confirm the filesystem is not mounted read-only","Create/repair the parent directories manually (mkdir -p) and ensure the running user owns them or has write permission","Point BEADS_PROXIED_SERVER_ROOT_PATH (or the sidecar root_path) at a writable location the bd user can create directories in","Check for MAC/ACL policies (SELinux denials in audit log, ACLs via getfacl) blocking directory creation"],"exampleFix":"// before: root in a read-only/privileged location\nexport BEADS_PROXIED_SERVER_ROOT_PATH=/usr/local/share/beads-dolt\n// after: writable, user-owned location\nexport BEADS_PROXIED_SERVER_ROOT_PATH=$HOME/.local/share/beads/shared-server/dolt","handlingStrategy":"validation","validationCode":"if err := os.MkdirAll(rootPath, 0o755); err != nil {\n\treturn fmt.Errorf(\"precheck: cannot create root %s: %w\", rootPath, err)\n}","typeGuard":null,"tryCatchPattern":"if err := os.MkdirAll(rootPath, config.BeadsDirPerm); err != nil {\n\tvar perr *fs.PathError\n\tif errors.As(err, &perr) && (errors.Is(perr.Err, syscall.EROFS) || errors.Is(perr.Err, syscall.ENOSPC)) {\n\t\t// surface disk/read-only guidance to the operator\n\t}\n\treturn err\n}","preventionTips":["Run df and confirm the target volume is writable before choosing a custom root","Never place the root under system-owned trees (/usr, /etc, /proc)","In containers, mount a writable volume for the Dolt root","Check SELinux/ACL policies when provisioning shared hosts"],"tags":["go","filesystem","mkdir","proxied-server"],"backgroundTag":"mkdir-permission-denied","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}