gastownhall/beads · warning

database config fix not applicable for Dolt backend (data is

Error message

database config fix not applicable for Dolt backend (data is on the server)

What it means

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.

Source

Thrown at cmd/bd/doctor/fix/database_config.go:33

func DatabaseConfig(path string) error {
	beadsDir, err := resolvedWorkspaceBeadsDir(path)
	if err != nil {
		return err
	}

	// Load existing config
	cfg, err := configfile.Load(beadsDir)
	if err != nil {
		return fmt.Errorf("failed to load config: %w", err)
	}
	if cfg == nil {
		// No config exists - nothing to fix
		return fmt.Errorf("no metadata.json found")
	}

	// Dolt backend stores data on the server — no local .db files to reconcile
	if cfg.GetBackend() == configfile.BackendDolt {
		return fmt.Errorf("database config fix not applicable for Dolt backend (data is on the server)")
	}

	fixed := false

	// Check if configured database name matches the actual .db file on disk
	actualDB := findActualDBFile(beadsDir)
	if actualDB != "" && cfg.Database != actualDB {
		fmt.Printf("  Updating database: %s → %s\n", cfg.Database, actualDB)
		cfg.Database = actualDB
		fixed = true
	}

	if !fixed {
		return fmt.Errorf("no configuration mismatches detected")
	}

	// Save updated config
	if err := cfg.Save(beadsDir); err != nil {

View on GitHub (pinned to 71377f2769)

Solutions

  1. Skip DatabaseConfig for Dolt-backed workspaces — no action needed; data lives on the server
  2. Gate the fix on backend type before calling: only invoke it when GetBackend() != BackendDolt
  3. If you believe a local .db file still needs reconciling, verify the backend field in .beads/metadata.json is correct first
  4. Use the ConfigValues fix instead if the issue is a stale SQLite-style database value under the Dolt backend

Example fix

// before
cfg, _ := configfile.Load(beadsDir)
_ = fix.DatabaseConfig(path)
// after
cfg, _ := configfile.Load(beadsDir)
if cfg.GetBackend() != configfile.BackendDolt {
    _ = fix.DatabaseConfig(path)
}
Defensive patterns

Strategy: type-guard

Validate before calling

cfg, err := configfile.Load(beadsDir)
if err != nil || cfg == nil { return err }
if cfg.GetBackend() == configfile.BackendDolt {
    return nil // DatabaseConfig is SQLite-only; skip
}

Type guard

func isSQLiteBackend(cfg *configfile.Config) bool {
    return cfg != nil && cfg.GetBackend() != configfile.BackendDolt
}

Try / catch

if err := fix.DatabaseConfig(path); err != nil {
    if strings.Contains(err.Error(), "not applicable for Dolt backend") {
        return nil // expected on Dolt workspaces; not a failure
    }
    return err
}

Prevention

When it happens

Trigger: Calling DatabaseConfig on a workspace whose metadata.json has backend set to "dolt" (GetBackend() == BackendDolt).

Common situations: 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.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/d35a85e82ebf43db. Report an issue: GitHub.