JuliusBrussee/caveman · error

budget %d is below SQLite minimum %d

Error message

budget %d is below SQLite minimum %d

What it means

Error "budget %d is below SQLite minimum %d" thrown in JuliusBrussee/caveman.

Source

Thrown at engine/ccr/store_sqlite.go:300

		return err
	}
	if !os.SameFile(info, opened) {
		return fmt.Errorf("file changed while opening")
	}
	return file.Chmod(0o600)
}

func configureStorageBudget(db *sql.DB, maxBytes int64) error {
	var pageSize int64
	if err := db.QueryRow(`PRAGMA page_size`).Scan(&pageSize); err != nil {
		return fmt.Errorf("read page size: %w", err)
	}
	if pageSize <= 0 {
		return errors.New("invalid sqlite page size")
	}
	maxPages := maxBytes / pageSize
	if maxPages < 16 {
		return fmt.Errorf("budget %d is below SQLite minimum %d", maxBytes, 16*pageSize)
	}
	var applied int64
	if err := db.QueryRow(fmt.Sprintf(`PRAGMA max_page_count=%d`, maxPages)).Scan(&applied); err != nil {
		return err
	}
	if applied < maxPages {
		maxPages = applied
	}
	autoCheckpoint := maxPages / 16
	if autoCheckpoint < 1 {
		autoCheckpoint = 1
	}
	if _, err := db.Exec(fmt.Sprintf(`PRAGMA wal_autocheckpoint=%d`, autoCheckpoint)); err != nil {
		return err
	}
	_, err := db.Exec(fmt.Sprintf(`PRAGMA journal_size_limit=%d`, maxBytes/8))
	return err
}

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Raise the budget to at least the SQLite minimum.

When it happens

Trigger: Thrown at engine/ccr/store_sqlite.go:300 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/e6a86ba02a9f92c5. Report an issue: GitHub.