{"record":{"id":"d0400e60d0c9d021","repo":"gastownhall/beads","slug":"failed-to-preview-pushes-in-s-s","errorCode":null,"errorMessage":"Failed to preview pushes in %s: %s","messagePattern":"Failed to preview pushes in (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/tracker/engine.go","lineNumber":996,"sourceCode":"\t\t}\n\t\tif opts.DryRun {\n\t\t\tif dryRunner, ok := e.Tracker.(BatchPushDryRunner); ok {\n\t\t\t\tbatchResult, err := dryRunner.BatchPushDryRun(ctx, pushIssues, forceIDs)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"previewing batch push: %w\", err)\n\t\t\t\t}\n\t\t\t\te.renderBatchDryRun(pushIssues, batchResult)\n\t\t\t\tstats.Created += len(batchResult.Created)\n\t\t\t\tstats.Updated += len(batchResult.Updated)\n\t\t\t\tstats.Skipped += len(batchResult.Skipped)\n\t\t\t\tstats.Errors += len(batchResult.Errors)\n\t\t\t\tstats.Warnings = append(stats.Warnings, batchResult.Warnings...)\n\t\t\t\tfor _, item := range batchResult.Errors {\n\t\t\t\t\tif item.LocalID != \"\" {\n\t\t\t\t\t\te.warn(\"Failed to preview push %s in %s: %s\", item.LocalID, e.Tracker.DisplayName(), item.Message)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\te.warn(\"Failed to preview pushes in %s: %s\", e.Tracker.DisplayName(), item.Message)\n\t\t\t\t}\n\t\t\t\treturn stats, nil\n\t\t\t}\n\t\t} else {\n\t\t\tbatchResult, err := batchTracker.BatchPush(ctx, pushIssues, forceIDs)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"batch pushing issues: %w\", err)\n\t\t\t}\n\t\t\te.applyBatchPushResult(ctx, batchResult)\n\t\t\tstats.Created += len(batchResult.Created)\n\t\t\tstats.Updated += len(batchResult.Updated)\n\t\t\tstats.Skipped += len(batchResult.Skipped)\n\t\t\tstats.Errors += len(batchResult.Errors)\n\t\t\tstats.Warnings = append(stats.Warnings, batchResult.Warnings...)\n\t\t\tfor _, item := range batchResult.Errors {\n\t\t\t\tif item.LocalID != \"\" {\n\t\t\t\t\te.warn(\"Failed to push %s in %s: %s\", item.LocalID, e.Tracker.DisplayName(), item.Message)\n\t\t\t\t\tcontinue","sourceCodeStart":978,"sourceCodeEnd":1014,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/tracker/engine.go#L978-L1014","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the message for the underlying cause; if it mentions auth/403/401, refresh the tracker credentials or token scopes.","Check the tracker configuration (repo, project, board) in the adapter config — a wrong target makes the whole batch preview fail.","Re-run with more verbose logging or check the adapter's own logs to identify which items were affected.","Retry later if the message indicates rate limiting; the batch-level preview may have exhausted the API budget."],"exampleFix":"// before: unauthenticated preview fails wholesale\n// GITHUB_TOKEN= (unset)\n// after\nexport GITHUB_TOKEN=ghp_...  # or re-authenticate: bd auth <tracker>","handlingStrategy":"validation","validationCode":"// Verify tracker connectivity/auth before a dry-run:\nfunc preflightTracker(ctx context.Context, t tracker.Tracker) error {\n    if p, ok := t.(interface{ Ping(context.Context) error }); ok {\n        if err := p.Ping(ctx); err != nil {\n            return fmt.Errorf(\"tracker %s unreachable or unauthorized: %w\", t.DisplayName(), err)\n        }\n    }\n    return nil\n}","typeGuard":"if dryRunner, ok := tracker.(BatchPushDryRunner); ok { /* only then is the dry-run preview path available */ }","tryCatchPattern":"stats, err := engine.Sync(ctx, opts)\nif err != nil {\n    return fmt.Errorf(\"previewing batch push: %w\", err)\n}\nfor _, w := range stats.Warnings {\n    log.Warnf(\"batch preview warning: %s\", w) // includes tracker name + cause\n}","preventionTips":["Check credentials (token expiry, scopes) before large syncs.","Confirm the target repo/project/board still exists after renames or moves.","Run the dry-run in CI with a preflight auth check so config drift is caught early.","Watch for rate-limit messages and schedule syncs within API budgets."],"tags":["sync","dry-run","batch-push","authentication"],"backgroundTag":"batch-preview-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}