{"record":{"id":"6a2238a291f76f3a","repo":"gastownhall/beads","slug":"dry-run-w-6a2238","errorCode":null,"errorMessage":"dry-run: %w","messagePattern":"dry-run: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/import_proxied_server.go","lineNumber":85,"sourceCode":"\t\tissues = out.kept\n\t\tdedupHits = out.hits\n\t}\n\n\tresult := importResultJSON{\n\t\tSource:    source,\n\t\tDedupHits: dedupHits,\n\t\tDryRun:    importDryRun,\n\t}\n\n\tif importDryRun {\n\t\tresult.Memories = len(memories)\n\t\tresult.Skipped = dedupHits\n\n\t\tclassification, err := uow.RunTxRead(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (*ImportResult, error) {\n\t\t\treturn classifyDryRunImport(ctx, uw.IssueUseCase(), issues, importAllowStale)\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"dry-run: %w\", err)\n\t\t}\n\t\tapplyImportDryRunClassification(&result, classification)\n\t\treturn renderImportDryRun(result, len(memories), source, dedupHits)\n\t}\n\n\t// Pre-filter half of the stale guard (bd-pkim8): report rows already\n\t// known stale and keep their labels/comments/dependencies out of the\n\t// batch entirely. A local update racing between this read and the batch\n\t// write is caught by RejectStaleUpserts inside the write transaction.\n\tvar staleSkippedIDs []string\n\tvar changePlan importChangePlan\n\tif !importAllowStale && len(issues) > 0 {\n\t\ttype staleOutcome struct {\n\t\t\tfiltered []*types.Issue\n\t\t\tskipped  []string\n\t\t\tplan     importChangePlan\n\t\t}\n\t\tout, err := uow.RunTxRead(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (staleOutcome, error) {","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/import_proxied_server.go#L67-L103","documentation":"During a dry-run import (`bd import --dry-run`) through the proxied path, the read-only classification transaction (dedup + stale classification of incoming issues) failed. The error wraps the underlying cause with a `dry-run:` prefix so the user knows the failure happened in the classification stage, before any data was written. Nothing was committed — the database is untouched.","triggerScenarios":"`bd import --dry-run` where `uow.RunTxRead` fails: storage unreachable, read transaction error, or classifyDryRunImport returning an error (e.g. GetIssuesByIDs failure during classification).","commonSituations":"Proxied server briefly down or connection dropped mid-command; database lock/permission problems; malformed prefix configuration surfaced by classification; network timeouts to a remote Dolt server.","solutions":["Read the wrapped `%w` cause — it names the actual failure (connection, permissions, query).","Confirm the proxied server / database is reachable and retry the dry-run.","Re-run the import with --dry-run after fixing connectivity to confirm classification succeeds.","If classification repeatedly fails on specific issues, validate the JSONL records (IDs, prefixes) against your configured issue-prefix."],"exampleFix":"// before\nbd import --dry-run issues.jsonl   # fails: dry-run: connection refused\n// after\nbd doctor                          # fix storage connectivity first\nbd import --dry-run issues.jsonl","handlingStrategy":"try-catch","validationCode":"// pre-check storage reachability\nif err := uow.RunTxRead(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (struct{}, error) {\n    return struct{}{}, nil\n}); err != nil {\n    return fmt.Errorf(\"storage unreachable, skipping dry-run: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := runImportRecordsProxied(ctx, issues, memories, source); err != nil {\n    var dryRunErr error\n    if strings.Contains(err.Error(), \"dry-run:\") {\n        // classification failed; nothing was written — safe to retry after fixing storage\n        dryRunErr = err\n    }\n    return dryRunErr\n}","preventionTips":["Run `bd doctor` before scripted dry-runs against remote/proxied storage.","Retry dry-runs on transient connectivity errors — they are side-effect free.","Keep the Dolt/SQLite backend local or on a low-latency link for large imports."],"tags":["dry-run","import","storage"],"backgroundTag":"dry-run-classification-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}