{"record":{"id":"83544d4d671b986d","repo":"gastownhall/beads","slug":"failed-to-check-source-repository-w","errorCode":null,"errorMessage":"failed to check source repository: %w","messagePattern":"failed to check source repository: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/migrate_issues.go","lineNumber":216,"sourceCode":"\t\t}\n\t\tfmt.Printf(\"\\n✓ Successfully migrated %d issues from %s to %s\\n\", len(migrationSet), p.from, p.to)\n\t}\n\n\treturn nil\n}\n\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: \"\",","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/migrate_issues.go#L198-L234","documentation":"This error wraps failures from the source-repository preflight check in validateRepos, which queries the --from repo for at least one issue to confirm the source exists and is readable. It means the validation query itself errored — not that the repo is empty (that produces error 1036 or a warning). The wrapped error holds the storage-level cause.","triggerScenarios":"validateRepos' source query (SourceRepo=&from, Limit=1) returns a non-nil error during executeMigrateIssues preflight.","commonSituations":"Typo'd repo path causing a store lookup error; database locked by a concurrent bd sync; storage backend unreachable (remote Dolt server down).","solutions":["Verify the --from repo identifier is correct and exists","Run `bd doctor` to confirm the local database is readable","Retry if a concurrent sync or lock was transient","Check storage backend connectivity if using a remote Dolt server"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# confirm the source repo resolves and has issues before migrating\nbd list --repo old-repo --limit 1 && echo OK\nbd doctor","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify repo identifiers with bd list before migrating","Keep the local database synced so source issues exist locally","Avoid running migrations while a sync holds the database"],"tags":["cli","migrations","preflight"],"backgroundTag":"source-repo-preflight-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}