{"record":{"id":"e528c512329830c1","repo":"gastownhall/beads","slug":"storage-backend-does-not-support-the-events-journa","errorCode":null,"errorMessage":"storage backend does not support the events journal","messagePattern":"storage backend does not support the events journal","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/events.go","lineNumber":318,"sourceCode":"\nfunc reportEventsPruned(n, before int64) error {\n\tif jsonOutput {\n\t\treturn outputJSON(map[string]any{\"pruned\": n})\n\t}\n\tfmt.Printf(\"Pruned %d events journal record(s) below seq %d\\n\", n, before)\n\treturn nil\n}\n\n// journalAccessor returns the active store's events-journal capability. The\n// embedded store and the server-mode store both provide it (via their own\n// transaction machinery); a backend that does not is reported as unsupported.\nfunc journalAccessor() (storage.EventsJournalAccessor, error) {\n\tif store == nil {\n\t\treturn nil, fmt.Errorf(\"no database connection available (%s)\", diagHint())\n\t}\n\tacc, ok := storage.UnwrapStore(store).(storage.EventsJournalAccessor)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"storage backend does not support the events journal\")\n\t}\n\treturn acc, nil\n}\n\n// readJournal reads records with seq greater than since from the active\n// storage seam. Proxied-server mode uses its transaction-bound UOW journal\n// capability; direct stores use EventsJournalAccessor.\n//\n// The projection onto the published envelope is eventsjournal.Records, the same\n// one GET /v0/beads/events serves from — see the note on eventsjournal.Record\n// for why there is exactly one.\nfunc readJournal(ctx context.Context, since int64, limit int) ([]eventsjournal.Record, error) {\n\tvar rows []storage.EventsJournalRow\n\tif usesProxiedServer() {\n\t\tif uowProvider == nil {\n\t\t\treturn nil, fmt.Errorf(\"no proxied-server unit-of-work provider available\")\n\t\t}\n\t\tuw, err := uowProvider.NewUOW(ctx)","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/events.go#L300-L336","documentation":"After confirming a store exists, journalAccessor unwraps it via storage.UnwrapStore and type-asserts storage.EventsJournalAccessor. If the concrete backend does not implement the events-journal capability, this error reports the backend as unsupported rather than panicking on a failed assertion. It is a capability gate per backend.","triggerScenarios":"Using a storage backend (or a wrapper/proxy store that hides the accessor) whose underlying driver does not provide the events journal, then invoking journal commands (`bd events` read or prune).","commonSituations":"Older beads database/driver version predating the events journal; custom or third-party storage backend; a wrapping store that UnwrapStore cannot see through.","solutions":["Upgrade beads and the Dolt driver so the backend implements EventsJournalAccessor","Check which backend is active (`bd doctor`) and switch to an embedded/Dolt backend that supports the journal","If a custom wrapper store is in play, make UnwrapStore able to reach the inner accessor","Treat as unsupported-capability: avoid journal subcommands on this backend"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// check backend capability up-front\nif !backendSupportsEventsJournal(activeBackend) { skipJournalFeatures() }","typeGuard":"func supportsEventsJournal(s storage.Store) bool {\n    _, ok := storage.UnwrapStore(s).(storage.EventsJournalAccessor)\n    return ok\n}","tryCatchPattern":"if err := journalCmd(ctx); err != nil {\n    if strings.Contains(err.Error(), \"does not support the events journal\") {\n        // degrade gracefully: hide journal features for this backend\n    }\n}","preventionTips":["Feature-detect EventsJournalAccessor before exposing journal UI","Keep beads and the storage driver upgraded to versions with journal support","Avoid wrapping stores that hide the inner accessor from UnwrapStore"],"tags":["cli","storage-backend","capability"],"backgroundTag":"unsupported-storage-backend","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}