gastownhall/beads · error

dry-run: %w

Error message

dry-run: %w

What it means

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.

Source

Thrown at cmd/bd/import_proxied_server.go:85

		issues = out.kept
		dedupHits = out.hits
	}

	result := importResultJSON{
		Source:    source,
		DedupHits: dedupHits,
		DryRun:    importDryRun,
	}

	if importDryRun {
		result.Memories = len(memories)
		result.Skipped = dedupHits

		classification, err := uow.RunTxRead(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (*ImportResult, error) {
			return classifyDryRunImport(ctx, uw.IssueUseCase(), issues, importAllowStale)
		})
		if err != nil {
			return fmt.Errorf("dry-run: %w", err)
		}
		applyImportDryRunClassification(&result, classification)
		return renderImportDryRun(result, len(memories), source, dedupHits)
	}

	// Pre-filter half of the stale guard (bd-pkim8): report rows already
	// known stale and keep their labels/comments/dependencies out of the
	// batch entirely. A local update racing between this read and the batch
	// write is caught by RejectStaleUpserts inside the write transaction.
	var staleSkippedIDs []string
	var changePlan importChangePlan
	if !importAllowStale && len(issues) > 0 {
		type staleOutcome struct {
			filtered []*types.Issue
			skipped  []string
			plan     importChangePlan
		}
		out, err := uow.RunTxRead(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (staleOutcome, error) {

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the wrapped `%w` cause — it names the actual failure (connection, permissions, query).
  2. Confirm the proxied server / database is reachable and retry the dry-run.
  3. Re-run the import with --dry-run after fixing connectivity to confirm classification succeeds.
  4. If classification repeatedly fails on specific issues, validate the JSONL records (IDs, prefixes) against your configured issue-prefix.

Example fix

// before
bd import --dry-run issues.jsonl   # fails: dry-run: connection refused
// after
bd doctor                          # fix storage connectivity first
bd import --dry-run issues.jsonl
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check storage reachability
if err := uow.RunTxRead(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (struct{}, error) {
    return struct{}{}, nil
}); err != nil {
    return fmt.Errorf("storage unreachable, skipping dry-run: %w", err)
}

Try / catch

if err := runImportRecordsProxied(ctx, issues, memories, source); err != nil {
    var dryRunErr error
    if strings.Contains(err.Error(), "dry-run:") {
        // classification failed; nothing was written — safe to retry after fixing storage
        dryRunErr = err
    }
    return dryRunErr
}

Prevention

When it happens

Trigger: `bd import --dry-run` where `uow.RunTxRead` fails: storage unreachable, read transaction error, or classifyDryRunImport returning an error (e.g. GetIssuesByIDs failure during classification).

Common situations: 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.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/6a2238a291f76f3a. Report an issue: GitHub.