{"record":{"id":"9d2d8362865425e5","repo":"gastownhall/beads","slug":"dry-run-w","errorCode":null,"errorMessage":"dry-run: %w","messagePattern":"dry-run: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/import.go","lineNumber":324,"sourceCode":"\t// Dedup: skip issues whose title matches an existing open issue\n\tdedupHits := 0\n\tif importDedup && len(issues) > 0 {\n\t\tissues, dedupHits = filterDuplicatesByTitle(ctx, store, issues)\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 := classifyDryRunImport(ctx, store, issues, importAllowStale)\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// Import memories\n\tfor _, mem := range memories {\n\t\tstorageKey := kvPrefix + memoryPrefix + mem.Key\n\t\tif err := store.SetConfig(ctx, storageKey, mem.Value); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to import memory %q: %w\", mem.Key, err)\n\t\t}\n\t\tresult.Memories++\n\t}\n\n\t// Import issues\n\tif len(issues) > 0 {\n\t\topts := ImportOptions{SkipPrefixValidation: true, AllowStale: importAllowStale}\n\t\timportResult, err := importIssuesCore(ctx, \"\", store, issues, opts)","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/import.go#L306-L342","documentation":"`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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nbd import --dry-run data.jsonl   # dry-run: prefix validation failed\n// after\nbd import --dry-run --allow-stale data.jsonl","handlingStrategy":"try-catch","validationCode":"bd doctor   # confirm store health before --dry-run\nbd import --dry-run data.jsonl","typeGuard":null,"tryCatchPattern":"if ! bd import --dry-run data.jsonl 2>err.log; then\n  grep -o 'dry-run: .*' err.log   # inspect inner classification cause\nfi","preventionTips":["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"],"tags":["cli","dry-run","validation"],"backgroundTag":"dry-run-classification-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}