gastownhall/beads · warning

Failed to preview pushes in %s: %s

Error message

Failed to preview pushes in %s: %s

What it means

Companion warning to the per-issue preview failure, used when the dry-run batch result contains an error item with no LocalID. Because no specific issue can be blamed, the engine attributes the failure to the whole preview batch for the tracker (identified by DisplayName). The push run itself still completes with stats and nil error; this is a logged diagnostic, not a fatal condition.

Source

Thrown at internal/tracker/engine.go:996

		}
		if opts.DryRun {
			if dryRunner, ok := e.Tracker.(BatchPushDryRunner); ok {
				batchResult, err := dryRunner.BatchPushDryRun(ctx, pushIssues, forceIDs)
				if err != nil {
					return nil, fmt.Errorf("previewing batch push: %w", err)
				}
				e.renderBatchDryRun(pushIssues, batchResult)
				stats.Created += len(batchResult.Created)
				stats.Updated += len(batchResult.Updated)
				stats.Skipped += len(batchResult.Skipped)
				stats.Errors += len(batchResult.Errors)
				stats.Warnings = append(stats.Warnings, batchResult.Warnings...)
				for _, item := range batchResult.Errors {
					if item.LocalID != "" {
						e.warn("Failed to preview push %s in %s: %s", item.LocalID, e.Tracker.DisplayName(), item.Message)
						continue
					}
					e.warn("Failed to preview pushes in %s: %s", e.Tracker.DisplayName(), item.Message)
				}
				return stats, nil
			}
		} else {
			batchResult, err := batchTracker.BatchPush(ctx, pushIssues, forceIDs)
			if err != nil {
				return nil, fmt.Errorf("batch pushing issues: %w", err)
			}
			e.applyBatchPushResult(ctx, batchResult)
			stats.Created += len(batchResult.Created)
			stats.Updated += len(batchResult.Updated)
			stats.Skipped += len(batchResult.Skipped)
			stats.Errors += len(batchResult.Errors)
			stats.Warnings = append(stats.Warnings, batchResult.Warnings...)
			for _, item := range batchResult.Errors {
				if item.LocalID != "" {
					e.warn("Failed to push %s in %s: %s", item.LocalID, e.Tracker.DisplayName(), item.Message)
					continue

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the message for the underlying cause; if it mentions auth/403/401, refresh the tracker credentials or token scopes.
  2. Check the tracker configuration (repo, project, board) in the adapter config — a wrong target makes the whole batch preview fail.
  3. Re-run with more verbose logging or check the adapter's own logs to identify which items were affected.
  4. Retry later if the message indicates rate limiting; the batch-level preview may have exhausted the API budget.

Example fix

// before: unauthenticated preview fails wholesale
// GITHUB_TOKEN= (unset)
// after
export GITHUB_TOKEN=ghp_...  # or re-authenticate: bd auth <tracker>
Defensive patterns

Strategy: validation

Validate before calling

// Verify tracker connectivity/auth before a dry-run:
func preflightTracker(ctx context.Context, t tracker.Tracker) error {
    if p, ok := t.(interface{ Ping(context.Context) error }); ok {
        if err := p.Ping(ctx); err != nil {
            return fmt.Errorf("tracker %s unreachable or unauthorized: %w", t.DisplayName(), err)
        }
    }
    return nil
}

Type guard

if dryRunner, ok := tracker.(BatchPushDryRunner); ok { /* only then is the dry-run preview path available */ }

Try / catch

stats, err := engine.Sync(ctx, opts)
if err != nil {
    return fmt.Errorf("previewing batch push: %w", err)
}
for _, w := range stats.Warnings {
    log.Warnf("batch preview warning: %s", w) // includes tracker name + cause
}

Prevention

When it happens

Trigger: Dry-run push where BatchPushDryRun returns an error item whose LocalID is empty — typically a batch-level failure inside the adapter: authentication/permission failure, batch API error, rate limit, or inability to map the failing item back to a local ID.

Common situations: Expired or missing tracker credentials (GITHUB_TOKEN etc.), revoked app installation, tracker project/board misconfiguration, or the remote API returning an opaque batch error the adapter cannot attribute to a single issue.

Related errors


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