{"record":{"id":"c76137237f2f1624","repo":"gastownhall/beads","slug":"creating-bd-dolt-ok-marker-w","errorCode":null,"errorMessage":"creating .bd-dolt-ok marker: %w","messagePattern":"creating \\.bd-dolt-ok marker: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/doctor/fix/dolt_format.go","lineNumber":26,"sourceCode":")\n\n// DoltFormat fixes the \"Dolt Format\" warning by seeding the .bd-dolt-ok marker\n// for pre-0.56 dolt databases that are otherwise functional.\n//\n// In server mode, the .beads/dolt/.dolt/ directory is vestigial from an older\n// embedded Dolt setup. The data lives on the Dolt server. Seeding the marker\n// tells future doctor checks that this database has been acknowledged.\nfunc DoltFormat(path string) error {\n\t// resolveBeadsDir follows .beads/redirect to find the actual beads directory\n\tbeadsDir := resolveBeadsDir(filepath.Join(path, \".beads\"))\n\tdoltDir := filepath.Join(beadsDir, \"dolt\")\n\n\tif !doltserver.IsPreV56DoltDir(doltDir) {\n\t\treturn nil // Already OK or no .dolt/ directory\n\t}\n\n\tif err := doltserver.MarkDoltDirCompatible(doltDir); err != nil {\n\t\treturn fmt.Errorf(\"creating .bd-dolt-ok marker: %w\", err)\n\t}\n\n\tfmt.Printf(\"  Seeded .bd-dolt-ok marker in %s\\n\", doltDir)\n\treturn nil\n}\n","sourceCodeStart":8,"sourceCodeEnd":32,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/doctor/fix/dolt_format.go#L8-L32","documentation":"DoltFormat seeds a .bd-dolt-ok marker file inside a pre-v56 .dolt directory so newer bd/Dolt versions know the directory is compatible. If MarkDoltDirCompatible cannot create or write that marker, the error is wrapped as \"creating .bd-dolt-ok marker: %w\" — typically a filesystem permission or path problem, not a Dolt problem.","triggerScenarios":"Running `bd doctor` format fix on a repo whose .dolt directory is pre-v56 format, when the process cannot write .bd-dolt-ok into doltDir: read-only filesystem, wrong ownership/permissions, or doltDir path issues (symlink, deleted mid-run).","commonSituations":"Repository cloned by another user with root-owned .dolt; repo checked out on a read-only mount or container volume; running bd with a restricted user/UID in CI.","solutions":["Fix permissions so the current user can write inside <repo>/.dolt (chown/chmod)","Check that the filesystem/mount is writable (not read-only)","Re-run `bd doctor` after fixing access; if persistent, manually create an empty .bd-dolt-ok file in the .dolt directory"],"exampleFix":"// before\n$ bd doctor  # creating .bd-dolt-ok marker: permission denied\n// after\n$ sudo chown -R $(whoami) .dolt/\n$ bd doctor  # Seeded .bd-dolt-ok marker in .dolt/","handlingStrategy":"validation","validationCode":"info, err := os.Stat(filepath.Join(doltDir, \".bd-dolt-ok\"))\nif err == nil && !info.IsDir() {\n\treturn nil // marker already present; skip\n}\nif info, err := os.Stat(doltDir); err != nil || !info.IsDir() {\n\treturn fmt.Errorf(\"dolt dir %s missing or inaccessible\", doltDir)\n}\nif f, err := os.OpenFile(filepath.Join(doltDir, \".probe\"), os.O_CREATE|os.O_WRONLY, 0o644); err != nil {\n\treturn fmt.Errorf(\"%s is not writable: %w\", doltDir, err)\n} else {\n\tf.Close(); os.Remove(filepath.Join(doltDir, \".probe\"))\n}","typeGuard":null,"tryCatchPattern":"if err := fix.DoltFormat(doltDir); err != nil {\n\tif strings.Contains(err.Error(), \"creating .bd-dolt-ok marker\") {\n\t\tlog.Printf(\"fix permissions on %s and retry: %v\", doltDir, err)\n\t}\n\treturn err\n}","preventionTips":["Run bd as a user with write access to the repo's .dolt directory","Avoid read-only mounts for working repositories","Pre-seed the .bd-dolt-ok marker when provisioning repos in CI/containers"],"tags":["filesystem","permissions","dolt","doctor"],"backgroundTag":"marker-file-write-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}