{"record":{"id":"aad2d0f4b0bb9645","repo":"gastownhall/beads","slug":"open-unit-of-work-w-aad2d0","errorCode":null,"errorMessage":"open unit of work: %w","messagePattern":"open unit of work: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/list_proxied_server.go","lineNumber":46,"sourceCode":"\tcase in.watchMode:\n\t\treturn runListProxiedWatch(cmd, ctx, in)\n\tcase !in.ReadyFlag && in.prettyFormat && in.ParentID != \"\":\n\t\treturn runListProxiedTree(ctx, in)\n\tdefault:\n\t\t// The --ready arm is not a case of its own any more: it is\n\t\t// ListRequest.ReadyFlag, and choosing the ready query from it is the\n\t\t// ROLE's job on both routes.\n\t\treturn runListProxiedPage(ctx, out, in)\n\t}\n}\n\nfunc openProxiedListUOW(ctx context.Context) (uow.UnitOfWork, error) {\n\tif uowProvider == nil {\n\t\treturn nil, errors.New(\"proxied-server UOW provider not initialized\")\n\t}\n\tuw, err := uowProvider.NewUOW(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"open unit of work: %w\", err)\n\t}\n\treturn uw, nil\n}\n\n// runListProxiedTree serves the ONE mode that is deliberately off the role: the\n// hierarchical --parent walk under pretty output. It consumes the FILTER as a\n// value, re-parenting a copy of it at every level, and it reaches no page\n// epilogue on either route.\nfunc runListProxiedTree(ctx context.Context, in listInput) error {\n\tuw, filter, err := openAndPrepare(ctx, in)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer uw.Close(ctx)\n\n\tif in.Offset > 0 {\n\t\treturn fmt.Errorf(\"--offset is not supported with hierarchical --parent + pretty/tree\")\n\t}","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/list_proxied_server.go#L28-L64","documentation":"openProxiedListUOW opens a unit of work via the proxied-server UOW provider; this wraps any provider.NewUOW error. When running against a daemon (proxied mode), list-family commands need this UOW to query storage remotely. A nil provider yields a distinct 'not initialized' error; this one means the open itself failed.","triggerScenarios":"Any proxied-server list-family command (list, duplicates, epic-status, close-eligible-epics, find-duplicates, graph) calling openProxiedListUOW when uowProvider.NewUOW(ctx) errors — typically daemon connection or session failure.","commonSituations":"bd daemon not running or crashed, stale socket after daemon restart, network/transport errors to the remote server, or Dolt server unavailability in proxied setups.","solutions":["Check the daemon is running: `bd doctor` or restart it (e.g. `bd daemon start` / let bd auto-spawn)","Retry the command — transient connection failures often resolve","Verify server connectivity/config (BD_HOST/remote settings) if using a remote daemon","Fall back to direct (non-proxied) mode if your setup allows it"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Check daemon availability before batch scripts\nbd doctor >/dev/null 2>&1 || { echo \"bd daemon/storage unhealthy\"; exit 1; }","typeGuard":null,"tryCatchPattern":"// Retry transient UOW open failures with backoff\nfor i in 1 2 3; do\n  bd list --status open && break\n  sleep $((i*i))\ndone","preventionTips":["Ensure the daemon is running before scripted list usage","Restart stale daemons after upgrades (version skew)","Treat 'open unit of work' as transient; add backoff retries"],"tags":["daemon","unit-of-work","proxied-server"],"backgroundTag":"uow-open-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}