{"record":{"id":"18133aafce5a3b7d","repo":"gastownhall/beads","slug":"s-18133a","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/migrate_issues.go","lineNumber":222,"sourceCode":"\nfunc validateRepos(ctx context.Context, s storage.DoltStorage, from, to string, strict bool) error {\n\t// migrate-issues is a round-trip path — opt out of BEADS_MAX_ROWS\n\t// (designer §4.1) so a misconfigured env doesn't abort migration.\n\t// Check if source repo has any issues\n\tfromIssues, err := s.SearchIssues(ctx, \"\", types.IssueFilter{\n\t\tSourceRepo:    &from,\n\t\tLimit:         1,\n\t\tMaxRows:       0,\n\t\tMaxRowsSource: \"\",\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to check source repository: %w\", err)\n\t}\n\n\tif len(fromIssues) == 0 {\n\t\tmsg := fmt.Sprintf(\"source repository '%s' has no issues\", from)\n\t\tif strict {\n\t\t\treturn fmt.Errorf(\"%s\", msg)\n\t\t}\n\t\tif !jsonOutput {\n\t\t\tfmt.Fprintf(os.Stderr, \"Warning: %s\\n\", msg)\n\t\t}\n\t}\n\n\t// Check if destination repo exists (just a warning)\n\ttoIssues, err := s.SearchIssues(ctx, \"\", types.IssueFilter{\n\t\tSourceRepo:    &to,\n\t\tLimit:         1,\n\t\tMaxRows:       0,\n\t\tMaxRowsSource: \"\",\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to check destination repository: %w\", err)\n\t}\n\n\tif len(toIssues) == 0 && !jsonOutput {","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/migrate_issues.go#L204-L240","documentation":"In strict mode this is an intentional abort: the source repository passed to `bd migrate-issues` contains no issues, so there is nothing to migrate and --strict refuses to continue. Without --strict the same condition is only a warning on stderr and the command proceeds (producing the earlier 'No issues match the specified filters' output).","triggerScenarios":"len(fromIssues) == 0 && strict in validateRepos — the Limit=1 probe query against the --from repo returned zero rows.","commonSituations":"Typo in the --from repo name; all issues already migrated in a previous run; filters exclude everything; pointing at a freshly cloned repo whose issues were never synced locally.","solutions":["Verify the --from repo name is spelled correctly","Run `bd list --repo <from>` to confirm issues exist locally and run `bd sync` if not","Drop --strict if an empty source is an expected no-op","Check whether a previous migration already consumed these issues"],"exampleFix":"// before: fails strict preflight\ncmd bd migrate-issues --from wrong-repo-name --to new-repo --strict\n// after: verify the source has issues first\nbd list --from old-repo --limit 1\ncmd bd migrate-issues --from old-repo --to new-repo --strict","handlingStrategy":"validation","validationCode":"# guard: only pass --strict when the source is known non-empty\ncount=$(bd list --repo old-repo --json | jq 'length')\nif [ \"$count\" -gt 0 ]; then\n  bd migrate-issues --from old-repo --to new-repo --strict\nfi","typeGuard":"function sourceHasIssues(listOutput) {\n  return Array.isArray(listOutput) && listOutput.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Check bd list output for the source repo before a strict migration","Confirm the exact repo spelling","Remember prior migrations may have already emptied the source","Sync first so local state reflects remote"],"tags":["cli","migrations","strict-mode"],"backgroundTag":"empty-source-repository","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}