gastownhall/beads · error

no proxied-server unit-of-work provider available

Error message

no proxied-server unit-of-work provider available

What it means

In proxied-server mode readJournal does not use the seam store; it needs a unit-of-work provider to open a transaction-bound view of the journal. When usesProxiedServer() is true but the package-level uowProvider is nil, this error fires instead of a nil-pointer dereference.

Source

Thrown at cmd/bd/events.go:334

	acc, ok := storage.UnwrapStore(store).(storage.EventsJournalAccessor)
	if !ok {
		return nil, fmt.Errorf("storage backend does not support the events journal")
	}
	return acc, nil
}

// readJournal reads records with seq greater than since from the active
// storage seam. Proxied-server mode uses its transaction-bound UOW journal
// capability; direct stores use EventsJournalAccessor.
//
// The projection onto the published envelope is eventsjournal.Records, the same
// one GET /v0/beads/events serves from — see the note on eventsjournal.Record
// for why there is exactly one.
func readJournal(ctx context.Context, since int64, limit int) ([]eventsjournal.Record, error) {
	var rows []storage.EventsJournalRow
	if usesProxiedServer() {
		if uowProvider == nil {
			return nil, fmt.Errorf("no proxied-server unit-of-work provider available")
		}
		uw, err := uowProvider.NewUOW(ctx)
		if err != nil {
			return nil, err
		}
		defer uw.Close(ctx)
		rows, err = uw.EventsJournalUseCase().Read(ctx, since, limit)
		if err != nil {
			return nil, err
		}
	} else {
		acc, err := journalAccessor()
		if err != nil {
			return nil, err
		}
		rows, err = acc.ReadEventsJournal(ctx, since, limit)
		if err != nil {
			return nil, err

View on GitHub (pinned to 71377f2769)

Solutions

  1. Verify the proxied server is a current version that supports the events-journal UOW endpoint
  2. Reconnect (`bd doctor`) so server-mode wiring, including uowProvider, is established
  3. If only local reading is needed, run without proxied-server mode so the embedded seam is used
  4. Report/upgrade if the proxy build predates the UOW journal support
Defensive patterns

Strategy: fallback

Validate before calling

if usesProxiedServer() && !serverSupportsUOW(serverVersion) {
    return errors.New("server lacks events-journal UOW support; use embedded mode")
}

Try / catch

recs, err := readJournal(ctx, since, limit)
if err != nil && strings.Contains(err.Error(), "unit-of-work provider") {
    recs, err = readJournalEmbeddedFallback(ctx, since, limit)
}

Prevention

When it happens

Trigger: `bd events` read path executing while the CLI is talking to a proxied server but the uowProvider was never wired (server connection established without UOW support, or wiring code skipped).

Common situations: Server/proxy version mismatch where the proxy does not expose the unit-of-work endpoint; a configuration that enables proxied-server mode without registering the provider; partial initialization of server-mode machinery.

Related errors


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