gastownhall/beads · error
dry-run: %w
Error message
dry-run: %w
What it means
`bd import --dry-run` first classifies what the import would create/update via classifyDryRunImport; if that classification call fails, the error is wrapped as `dry-run: ...`. The actual root cause is inside the classifier (typically a store or validation failure).
Source
Thrown at cmd/bd/import.go:324
// Dedup: skip issues whose title matches an existing open issue
dedupHits := 0
if importDedup && len(issues) > 0 {
issues, dedupHits = filterDuplicatesByTitle(ctx, store, issues)
}
result := importResultJSON{
Source: source,
DedupHits: dedupHits,
DryRun: importDryRun,
}
if importDryRun {
result.Memories = len(memories)
result.Skipped = dedupHits
classification, err := classifyDryRunImport(ctx, store, issues, importAllowStale)
if err != nil {
return fmt.Errorf("dry-run: %w", err)
}
applyImportDryRunClassification(&result, classification)
return renderImportDryRun(result, len(memories), source, dedupHits)
}
// Import memories
for _, mem := range memories {
storageKey := kvPrefix + memoryPrefix + mem.Key
if err := store.SetConfig(ctx, storageKey, mem.Value); err != nil {
return fmt.Errorf("failed to import memory %q: %w", mem.Key, err)
}
result.Memories++
}
// Import issues
if len(issues) > 0 {
opts := ImportOptions{SkipPrefixValidation: true, AllowStale: importAllowStale}
importResult, err := importIssuesCore(ctx, "", store, issues, opts)View on GitHub (pinned to 71377f2769)
Solutions
- Read the wrapped inner error after `dry-run:` for the real cause
- Run `bd doctor` to check database health and locks
- Retry with `--allow-stale` if staleness validation is the blocker and you accept stale records
- Re-run after closing other bd processes holding the database
Example fix
// before bd import --dry-run data.jsonl # dry-run: prefix validation failed // after bd import --dry-run --allow-stale data.jsonl
Defensive patterns
Strategy: try-catch
Validate before calling
bd doctor # confirm store health before --dry-run bd import --dry-run data.jsonl
Try / catch
if ! bd import --dry-run data.jsonl 2>err.log; then grep -o 'dry-run: .*' err.log # inspect inner classification cause fi
Prevention
- Run bd import --dry-run first on all non-trivial imports
- Keep only one bd process writing to a database at a time
- Configure issue prefixes consistently between source and target repos
- Use --allow-stale deliberately, not by default
When it happens
Trigger: Running `bd import --dry-run file.jsonl` where classifyDryRunImport hits a store error — closed/nil store handle, database locked, or prefix/staleness validation blowing up on the candidate issues.
Common situations: Dry-run against a database opened by another process with a conflicting lock; issues referencing prefixes not configured locally; stale imports attempted without --allow-stale.
Related errors
- got %d close reasons for %d issue IDs; provide exactly one s
- cannot specify both --reason-file and --reason/--resolution/
- --reason-file %q is empty; close reason is required
- invalid mode '%s', must be 'compile' or 'runtime'
- runtime mode requires all variables to have values Missing:
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/9d2d8362865425e5.
Report an issue: GitHub.