gastownhall/beads · error

%s

Error message

%s

What it means

doltBackupConfigPath resolves the path of the dolt-backup.json config file inside the active beads workspace directory. When beads.FindBeadsDir() returns an empty string — meaning no .beads workspace was found walking up from the cwd — the function wraps the shared 'no active beads workspace found' message via fmt.Errorf("%s", ...) and fails. It is a sentinel-style guard so all backup config operations fail consistently outside a workspace.

Source

Thrown at cmd/bd/backup_dolt.go:226

}

// doltBackupConfig stores the backup destination info in .beads/dolt-backup.json
type doltBackupConfig struct {
	BackupURL  string    `json:"backup_url"`
	BackupName string    `json:"backup_name"`
	CreatedAt  time.Time `json:"created_at"`
}

// doltBackupState tracks the last successful Dolt backup sync.
type doltBackupState struct {
	LastSync time.Time `json:"last_sync"`
	Duration string    `json:"duration"`
}

func doltBackupConfigPath() (string, error) {
	beadsDir := beads.FindBeadsDir()
	if beadsDir == "" {
		return "", fmt.Errorf("%s", activeWorkspaceNotFoundError())
	}
	return filepath.Join(beadsDir, "dolt-backup.json"), nil
}

func doltBackupStatePath() (string, error) {
	beadsDir := beads.FindBeadsDir()
	if beadsDir == "" {
		return "", fmt.Errorf("%s", activeWorkspaceNotFoundError())
	}
	return filepath.Join(beadsDir, "dolt-backup-state.json"), nil
}

func saveDoltBackupConfig(backupURL string) error {
	path, err := doltBackupConfigPath()
	if err != nil {
		return err
	}
	cfg := doltBackupConfig{

View on GitHub (pinned to 71377f2769)

Solutions

  1. cd into the repository/workspace that contains the .beads directory before running bd backup commands
  2. Run 'bd init' to create a new beads workspace if none exists
  3. Run 'bd where' to inspect how bd resolved (or failed to resolve) the workspace
  4. Check that the BEADS_DIR environment variable, if set, points at a valid beads workspace

Example fix

// before (shell, run in a non-workspace dir)
bd backup config save https://doltremote.example.com/mydb
// after
cd /path/to/repo-with-.beads && bd backup config save https://doltremote.example.com/mydb
Defensive patterns

Strategy: validation

Validate before calling

if beads.FindBeadsDir() == "" {
    return errors.New("not inside a beads workspace; run 'bd init' first")
}
// safe to proceed with doltBackupConfigPath()

Try / catch

path, err := doltBackupConfigPath()
if err != nil {
    fmt.Fprintln(os.Stderr, err) // includes active-workspace-not-found message
    os.Exit(1)
}

Prevention

When it happens

Trigger: Calling bd backup config save/load (saveDoltBackupConfig, loadDoltBackupConfig) or any anonymous caller of doltBackupConfigPath from a directory that is not inside a beads workspace (.beads dir absent up the tree) or when BEADS_DIR resolution fails.

Common situations: Running 'bd backup' commands outside an initialized repo, running from a subdirectory after the .beads dir was deleted or renamed, CI jobs checking out only part of a repo, or a misconfigured BEADS_DIR environment variable.

Related errors


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