{"record":{"id":"630ef29841695b11","repo":"gastownhall/beads","slug":"create-config-yaml-w","errorCode":null,"errorMessage":"create config.yaml: %w","messagePattern":"create config\\.yaml: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/bootstrap.go","lineNumber":839,"sourceCode":"\tcase cfg.IsDoltProxiedServerMode():\n\t\tcfg.DoltMode = configfile.DoltModeProxiedServer\n\tcase cfg.IsDoltServerMode() || doltserver.IsSharedServerMode():\n\t\tcfg.DoltMode = configfile.DoltModeServer\n\tdefault:\n\t\tcfg.DoltMode = configfile.DoltModeEmbedded\n\t}\n\t// Mirror init's convention: metadata.json database points at the Dolt\n\t// directory rather than the legacy \"beads.db\" placeholder.\n\tif cfg.Database == \"\" || cfg.Database == beads.CanonicalDatabaseName {\n\t\tcfg.Database = \"dolt\"\n\t}\n\n\tif err := cfg.Save(beadsDir); err != nil {\n\t\treturn fmt.Errorf(\"write metadata.json: %w\", err)\n\t}\n\n\tif err := createConfigYaml(beadsDir, false, \"\"); err != nil {\n\t\treturn fmt.Errorf(\"create config.yaml: %w\", err)\n\t}\n\tif err := doctor.EnsureGitignoreForBeadsDir(beadsDir); err != nil {\n\t\treturn fmt.Errorf(\"ensure .beads/.gitignore: %w\", err)\n\t}\n\n\t// Persist sync.remote so subsequent fresh clones (and bd bootstrap\n\t// retries) can rediscover the remote without re-probing origin refs.\n\tif syncRemote != \"\" {\n\t\tif err := config.SetYamlConfigInDir(beadsDir, \"sync.remote\", syncRemote); err != nil {\n\t\t\treturn fmt.Errorf(\"persist sync.remote to config.yaml: %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype remoteCloneMode int\n","sourceCodeStart":821,"sourceCodeEnd":857,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/bootstrap.go#L821-L857","documentation":"Wrapped by finalizeSyncedBootstrap in cmd/bd/bootstrap.go:839 after a successful sync clone, when createConfigYaml fails to write the .beads/config.yaml file. This file matches the on-disk layout bd init produces, so bootstrap cannot be finalized without it. The underlying error is a filesystem write failure (permissions, read-only mount, or path problems).","triggerScenarios":"bd bootstrap (or bd init clone path via executeSyncAction) reaches finalizeSyncedBootstrap on a synced workspace and createConfigYaml fails because the .beads directory is unwritable, config.yaml exists as a directory, or the filesystem is read-only.","commonSituations":"Cloning into a directory owned by another user; .beads on a read-only NFS/CI mount; a stray config.yaml directory left by a failed run; running under a different UID than the repo owner.","solutions":["Check permissions on the .beads directory and fix with chown/chmod so the current user can write","Remove any stray config.yaml directory (not file) inside .beads","Ensure the target filesystem is writable (not mounted read-only, disk not full)","Re-run bd bootstrap after fixing; the operation is idempotent"],"exampleFix":"// before: .beads owned by root\n$ bd bootstrap\n// error: create config.yaml: permission denied\n// after\n$ sudo chown -R $(whoami) .beads\n$ bd bootstrap","handlingStrategy":"validation","validationCode":"// before running bd bootstrap\nif [ ! -w .beads ]; then echo '.beads not writable'; exit 1; fi\nif [ -d .beads/config.yaml ]; then echo 'config.yaml is a directory'; exit 1; fi","typeGuard":null,"tryCatchPattern":"err := bdBootstrap(ctx)\nif err != nil {\n\tvar pe *fs.PathError\n\tif errors.As(err, &pe) && errors.Is(pe.Err, os.ErrPermission) {\n\t\t// prompt for ownership/permission fix and retry\n\t}\n}","preventionTips":["Ensure the .beads directory is owned by the user running bd before bootstrapping","Avoid running bd bootstrap under sudo, which leaves root-owned files","Do not mount the repo workspace read-only during bootstrap","Re-run bd bootstrap after any interruption — finalize steps are idempotent"],"tags":["filesystem","permissions","bootstrap"],"backgroundTag":"filesystem-write-permission-denied","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}