gastownhall/beads · error

failed to check source repository: %w

Error message

failed to check source repository: %w

What it means

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.

Source

Thrown at cmd/bd/migrate_issues.go:216

		}
		fmt.Printf("\n✓ Successfully migrated %d issues from %s to %s\n", len(migrationSet), p.from, p.to)
	}

	return nil
}

func validateRepos(ctx context.Context, s storage.DoltStorage, from, to string, strict bool) error {
	// migrate-issues is a round-trip path — opt out of BEADS_MAX_ROWS
	// (designer §4.1) so a misconfigured env doesn't abort migration.
	// Check if source repo has any issues
	fromIssues, err := s.SearchIssues(ctx, "", types.IssueFilter{
		SourceRepo:    &from,
		Limit:         1,
		MaxRows:       0,
		MaxRowsSource: "",
	})
	if err != nil {
		return fmt.Errorf("failed to check source repository: %w", err)
	}

	if len(fromIssues) == 0 {
		msg := fmt.Sprintf("source repository '%s' has no issues", from)
		if strict {
			return fmt.Errorf("%s", msg)
		}
		if !jsonOutput {
			fmt.Fprintf(os.Stderr, "Warning: %s\n", msg)
		}
	}

	// Check if destination repo exists (just a warning)
	toIssues, err := s.SearchIssues(ctx, "", types.IssueFilter{
		SourceRepo:    &to,
		Limit:         1,
		MaxRows:       0,
		MaxRowsSource: "",

View on GitHub (pinned to 71377f2769)

Solutions

  1. Verify the --from repo identifier is correct and exists
  2. Run `bd doctor` to confirm the local database is readable
  3. Retry if a concurrent sync or lock was transient
  4. Check storage backend connectivity if using a remote Dolt server
Defensive patterns

Strategy: validation

Validate before calling

# confirm the source repo resolves and has issues before migrating
bd list --repo old-repo --limit 1 && echo OK
bd doctor

Prevention

When it happens

Trigger: validateRepos' source query (SourceRepo=&from, Limit=1) returns a non-nil error during executeMigrateIssues preflight.

Common situations: Typo'd repo path causing a store lookup error; database locked by a concurrent bd sync; storage backend unreachable (remote Dolt server down).

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/83544d4d671b986d. Report an issue: GitHub.