{"record":{"id":"979e91e21b67c13b","repo":"gastownhall/beads","slug":"failed-to-check-destination-repository-w","errorCode":null,"errorMessage":"failed to check destination repository: %w","messagePattern":"failed to check destination repository: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/migrate_issues.go","lineNumber":237,"sourceCode":"\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 {\n\t\tfmt.Fprintf(os.Stderr, \"Info: destination repository '%s' will be created\\n\", to)\n\t}\n\n\treturn nil\n}\n\nfunc findCandidateIssues(ctx context.Context, s storage.DoltStorage, p migrateIssuesParams) ([]string, error) {\n\t// Build filter from params. Opt out of BEADS_MAX_ROWS (designer §4.1) —\n\t// migrate-issues is round-trip and must enumerate every candidate.\n\tfilter := types.IssueFilter{\n\t\tSourceRepo:    &p.from,\n\t\tMaxRows:       0,\n\t\tMaxRowsSource: \"\",\n\t}\n","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/migrate_issues.go#L219-L255","documentation":"This error wraps failures from the destination-repository preflight check in validateRepos, which probes the --to repo for existing issues. It means the validation query errored — note that an empty destination is NOT an error; it only prints an informational message that the repo will be created. The wrapped error holds the real cause.","triggerScenarios":"validateRepos' destination query (SourceRepo=&to, Limit=1) returns a non-nil error during executeMigrateIssues preflight.","commonSituations":"Storage error probing a not-yet-created destination repo path; database lock from a concurrent bd process; invalid characters in the --to repo name rejected by the store layer.","solutions":["Inspect the wrapped inner error for the storage-level cause","Validate the --to repo name contains only legal characters","Run `bd doctor` to rule out local database problems","Retry if the failure was a transient lock"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# rule out local storage problems before migrating\nbd doctor\n# validate the destination name characters\n[[ \"$to\" =~ ^[A-Za-z0-9._-]+$ ]] || echo \"invalid repo name\"","typeGuard":null,"tryCatchPattern":"if err := runMigrate(); err != nil {\n    if strings.Contains(err.Error(), \"failed to check destination repository\") {\n        log.Printf(\"destination probe failed: %v\", errors.Unwrap(err))\n    }\n    return err\n}","preventionTips":["Use simple, legal repo names for --to","Run bd doctor if preflight checks keep failing","Avoid concurrent bd processes during migration"],"tags":["cli","migrations","preflight"],"backgroundTag":"destination-repo-preflight-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}