{"record":{"id":"0816ca229fc4082b","repo":"gastownhall/beads","slug":"no-storage-available","errorCode":null,"errorMessage":"no storage available","messagePattern":"no storage available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/list.go","lineNumber":34,"sourceCode":"\n// storageExecutor handles operations that need a store connection\ntype storageExecutor func(store storage.DoltStorage) error\n\n// withStorage executes an operation with either the direct store or a read-only store\nfunc withStorage(ctx context.Context, store storage.DoltStorage, dbPath string, fn storageExecutor) error {\n\tif store != nil {\n\t\treturn fn(store)\n\t} else if dbPath != \"\" {\n\t\t// Open read-only connection using repo metadata when available so\n\t\t// helper paths keep the correct Dolt database and server endpoint.\n\t\troStore, err := openReadOnlyStoreForDBPath(ctx, dbPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() { _ = roStore.Close() }() // Best effort cleanup\n\t\treturn fn(roStore)\n\t}\n\treturn fmt.Errorf(\"no storage available\")\n}\n\n// issueSnapshot builds a comparable string from issue IDs, statuses, and\n// update times so we can detect when the result set has changed.\nfunc issueSnapshot(issues []*types.Issue) string {\n\tvar b strings.Builder\n\tfor _, issue := range issues {\n\t\tfmt.Fprintf(&b, \"%s:%s:%d;\", issue.ID, issue.Status, issue.UpdatedAt.UnixNano())\n\t}\n\treturn b.String()\n}\n\n// skipLabelsIssueView wraps IssueWithCounts so the JSON encoder always emits\n// `labels: []` regardless of the omitempty tag on Issue.Labels. AD-02 contract:\n// with --skip-labels, every issue's labels field is present and empty.\ntype skipLabelsIssueView struct {\n\t*types.IssueWithCounts\n\tLabels []string `json:\"labels\"`","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/list.go#L16-L52","documentation":"withStorage is a helper that obtains a store (e.g. an open read-only store or the active one) and runs a callback with it; every fallback path failed to produce a store, so it returns the plain 'no storage available' error. Commands like list/where rely on it to read issues.","triggerScenarios":"Running a command that needs storage (getHierarchicalChildren, findAllDescendants, the `where` command path) when no embedded store can be opened, no daemon store is connected, and no ro-store could be created.","commonSituations":"Running bd outside an initialized repo (no .beads database); daemon not running; BD_DAEMON/whoami misconfiguration; database file missing or permissions deny opening it.","solutions":["Run `bd init` in the project or cd into the repository containing the .beads database","Ensure the bd daemon is running (`bd daemon` status; restart if needed) and BD_DAEMON points at it","Check file permissions on the .beads directory and database files"],"exampleFix":"// before\n$ bd list --json\nError: no storage available\n// after\n$ bd init\n$ bd list --json","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(filepath.Join(\".beads\")); err != nil {\n\treturn fmt.Errorf(\"no bd storage here; run 'bd init' first\")\n}","typeGuard":null,"tryCatchPattern":"out, err := runList(ctx)\nif err != nil && strings.Contains(err.Error(), \"no storage available\") {\n\t// fallback: ensure daemon up, or run 'bd init' then retry\n}","preventionTips":["Initialize bd (`bd init`) before running read commands in a new repo","Check daemon connectivity when using daemon mode","Verify .beads directory exists and is readable by the bd process"],"tags":["database","storage","store","configuration"],"backgroundTag":"no-storage-available","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}