{"record":{"id":"d35a85e82ebf43db","repo":"gastownhall/beads","slug":"database-config-fix-not-applicable-for-dolt-backen","errorCode":null,"errorMessage":"database config fix not applicable for Dolt backend (data is on the server)","messagePattern":"database config fix not applicable for Dolt backend \\(data is on the server\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/bd/doctor/fix/database_config.go","lineNumber":33,"sourceCode":"func DatabaseConfig(path string) error {\n\tbeadsDir, err := resolvedWorkspaceBeadsDir(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Load existing config\n\tcfg, err := configfile.Load(beadsDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to load config: %w\", err)\n\t}\n\tif cfg == nil {\n\t\t// No config exists - nothing to fix\n\t\treturn fmt.Errorf(\"no metadata.json found\")\n\t}\n\n\t// Dolt backend stores data on the server — no local .db files to reconcile\n\tif cfg.GetBackend() == configfile.BackendDolt {\n\t\treturn fmt.Errorf(\"database config fix not applicable for Dolt backend (data is on the server)\")\n\t}\n\n\tfixed := false\n\n\t// Check if configured database name matches the actual .db file on disk\n\tactualDB := findActualDBFile(beadsDir)\n\tif actualDB != \"\" && cfg.Database != actualDB {\n\t\tfmt.Printf(\"  Updating database: %s → %s\\n\", cfg.Database, actualDB)\n\t\tcfg.Database = actualDB\n\t\tfixed = true\n\t}\n\n\tif !fixed {\n\t\treturn fmt.Errorf(\"no configuration mismatches detected\")\n\t}\n\n\t// Save updated config\n\tif err := cfg.Save(beadsDir); err != nil {","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/doctor/fix/database_config.go#L15-L51","documentation":"DatabaseConfig only applies to SQLite backends: it reconciles the configured database name with the actual .db file found in .beads/. When metadata.json's backend is Dolt, there are no local .db files to reconcile (data lives on the Dolt server), so the fix refuses to run with this error.","triggerScenarios":"Calling DatabaseConfig on a workspace whose metadata.json has backend set to \"dolt\" (GetBackend() == BackendDolt).","commonSituations":"Running the generic `bd doctor fix --all` on a Dolt-backed workspace where this SQLite-specific fix is invoked unconditionally; a workspace migrated from SQLite to Dolt still triggering DB-file reconciliation.","solutions":["Skip DatabaseConfig for Dolt-backed workspaces — no action needed; data lives on the server","Gate the fix on backend type before calling: only invoke it when GetBackend() != BackendDolt","If you believe a local .db file still needs reconciling, verify the backend field in .beads/metadata.json is correct first","Use the ConfigValues fix instead if the issue is a stale SQLite-style database value under the Dolt backend"],"exampleFix":"// before\ncfg, _ := configfile.Load(beadsDir)\n_ = fix.DatabaseConfig(path)\n// after\ncfg, _ := configfile.Load(beadsDir)\nif cfg.GetBackend() != configfile.BackendDolt {\n    _ = fix.DatabaseConfig(path)\n}","handlingStrategy":"type-guard","validationCode":"cfg, err := configfile.Load(beadsDir)\nif err != nil || cfg == nil { return err }\nif cfg.GetBackend() == configfile.BackendDolt {\n    return nil // DatabaseConfig is SQLite-only; skip\n}","typeGuard":"func isSQLiteBackend(cfg *configfile.Config) bool {\n    return cfg != nil && cfg.GetBackend() != configfile.BackendDolt\n}","tryCatchPattern":"if err := fix.DatabaseConfig(path); err != nil {\n    if strings.Contains(err.Error(), \"not applicable for Dolt backend\") {\n        return nil // expected on Dolt workspaces; not a failure\n    }\n    return err\n}","preventionTips":["Check GetBackend() before invoking backend-specific fixes","In fix-all flows, filter fixes by workspace backend","For Dolt workspaces use ConfigValues to correct stale SQLite-style database values"],"tags":["go","config","dolt","inapplicable-fix"],"backgroundTag":"fix-not-applicable-for-backend","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}