{"record":{"id":"1bf620f15ab57f8a","repo":"gastownhall/beads","slug":"no-auto-routed-store-available","errorCode":null,"errorMessage":"no auto-routed store available","messagePattern":"no auto-routed store available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/close.go","lineNumber":718,"sourceCode":"// no-op for routed-via-shared-handle entries because they don't own the handle.\nfunc resolveCloseTargets(ctx context.Context, localStore storage.DoltStorage, ids []string) ([]*RoutedResult, func(), error) {\n\tresults := make([]*RoutedResult, 0, len(ids))\n\tvar sharedRouted storage.DoltStorage\n\tvar sharedRoutedTried bool\n\tcleanup := func() {\n\t\tfor _, r := range results {\n\t\t\tr.Close()\n\t\t}\n\t\tif sharedRouted != nil {\n\t\t\t_ = sharedRouted.Close()\n\t\t}\n\t}\n\tensureShared := func() (storage.DoltStorage, error) {\n\t\tif sharedRouted != nil {\n\t\t\treturn sharedRouted, nil\n\t\t}\n\t\tif sharedRoutedTried {\n\t\t\treturn nil, fmt.Errorf(\"no auto-routed store available\")\n\t\t}\n\t\tsharedRoutedTried = true\n\t\trs, routed, _, err := openRoutedReadStore(ctx, localStore)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !routed {\n\t\t\treturn nil, fmt.Errorf(\"no auto-routed store available\")\n\t\t}\n\t\tsharedRouted = rs\n\t\treturn rs, nil\n\t}\n\tfor _, id := range ids {\n\t\t// Local first.\n\t\tif r, err := resolveAndGetFromStore(ctx, localStore, id, false); err == nil {\n\t\t\tresults = append(results, r)\n\t\t\tcontinue\n\t\t} else if !isNotFoundErr(err) {","sourceCodeStart":700,"sourceCodeEnd":736,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/close.go#L700-L736","documentation":"Inside bd close's routing logic, ensureShared lazily opens an auto-routed shared Dolt store. If the routed store was already attempted once and failed/absent, subsequent calls short-circuit with 'no auto-routed store available'. This prevents repeatedly retrying discovery that already failed.","triggerScenarios":"Closing multiple issues in one invocation where closing the first attempt triggered ensureShared, openRoutedReadStore failed or wasn't routed, and a later issue again needs the shared store — the cached failure is re-reported.","commonSituations":"Working in a repo without a shared/remote Dolt routing configuration; offline with routing configured but unreachable; .beads routing metadata pointing nowhere.","solutions":["Ensure the repo has a valid routed/shared database configuration (check .beads routing config and `bd dolt` setup).","Fix the underlying openRoutedReadStore error surfaced earlier (sync/remote availability).","Close issues one at a time locally if no shared store is intended."],"exampleFix":"// before: no routing configured\nbd close bd-1 bd-2  # no auto-routed store available\n// after\nbd dolt push  # or configure shared routing first, then close","handlingStrategy":"fallback","validationCode":"bd doctor 2>/dev/null | grep -i rout   # or check .beads routing config before batch closes\ntest -f .beads/config.json && jq -e .routed .beads/config.json","typeGuard":null,"tryCatchPattern":"if err := runClose(...); err != nil {\n\tif strings.Contains(err.Error(), \"no auto-routed store available\") {\n\t\t// close locally one issue at a time, or configure routing and retry\n\t}\n}","preventionTips":["Set up shared routing before team workflows","Run bd sync/doctor after cloning","Don't rely on routed lookups in isolated clones"],"tags":["storage","routing","dolt"],"backgroundTag":"no-shared-store-available","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}