{"record":{"id":"6ff453dfca44b379","repo":"gastownhall/beads","slug":"failed-to-create-s-in-s-v","errorCode":null,"errorMessage":"Failed to create %s in %s: %v","messagePattern":"Failed to create (.+?) in (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/tracker/engine.go","lineNumber":1081,"sourceCode":"\t\t\tcontinue\n\t\t}\n\n\t\t// FormatDescription hook: apply to a copy so we don't mutate local data.\n\t\tpushIssue := issue\n\t\tif e.PushHooks != nil && e.PushHooks.FormatDescription != nil {\n\t\t\tcopy := *issue\n\t\t\tcopy.Description = e.PushHooks.FormatDescription(issue)\n\t\t\tpushIssue = &copy\n\t\t}\n\n\t\tif willCreate {\n\t\t\t// Create in external tracker\n\t\t\tcreated, err := e.Tracker.CreateIssue(ctx, pushIssue)\n\t\t\tif err != nil {\n\t\t\t\tif isRateLimitExhausted(err) {\n\t\t\t\t\treturn stats, fmt.Errorf(\"sync aborted: %w\", err)\n\t\t\t\t}\n\t\t\t\te.warn(\"Failed to create %s in %s: %v\", issue.ID, e.Tracker.DisplayName(), err)\n\t\t\t\tstats.Errors++\n\t\t\t\tif isRateLimitedErr(err) {\n\t\t\t\t\te.warnRateLimitAbort(err, len(issues)-stats.Created-stats.Updated-stats.Skipped-stats.Errors)\n\t\t\t\t\treturn stats, nil\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Update local issue with external ref\n\t\t\tref := e.Tracker.BuildExternalRef(created)\n\t\t\tupdates := map[string]interface{}{\"external_ref\": ref}\n\t\t\tif err := e.Store.UpdateIssue(ctx, issue.ID, updates, e.Actor); err != nil {\n\t\t\t\te.warn(\"Failed to update external_ref for %s: %v\", issue.ID, err)\n\t\t\t\tstats.Errors++\n\t\t\t\t// Note: issue WAS created externally, so we still count Created\n\t\t\t\t// but also flag the error so the user knows the link is broken\n\t\t\t}\n\t\t\t// Surface any partial-success warnings from the create (e.g. a","sourceCodeStart":1063,"sourceCodeEnd":1099,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/tracker/engine.go#L1063-L1099","documentation":"Warning from the non-batch (per-issue) push path when Tracker.CreateIssue fails for an individual issue. Unless the error signals fully exhausted rate limits (which aborts the sync with an error), the engine logs this warning, increments stats.Errors, and continues with the next issue. If the error is merely rate-limited (not exhausted), it also warns how many issues remain and stops gracefully.","triggerScenarios":"Sync/doPush falling through to the per-issue loop (tracker does not implement BatchPushTracker) where CreateIssue returns an error — remote validation failure (422), missing required fields, permission denied, rate limit, or network error during issue creation.","commonSituations":"Token lacking repo write scope, issue title/description exceeding tracker limits, required custom fields (Jira) not mapped, duplicate detection rejecting the create, or hitting GitHub's secondary rate limits when creating many issues quickly.","solutions":["Read the %v cause: fix validation problems (shorten title, map required fields, create missing labels) and re-push the specific issue.","If permission denied, grant the token/app write access to the target repository/project.","If rate limited, wait for the reset window and re-run; unchanged issues skip via push hashes so only uncreated items retry.","As a workaround, confirm whether the tracker adapter supports batch push — the batch path handles per-item errors more gracefully."],"exampleFix":"// before: title exceeds tracker limit -> create rejected\nissue.Title = strings.Repeat(\"detail \", 60)\n// after\nissue.Title = \"Shorter compliant title\" // then re-run bd push","handlingStrategy":"try-catch","validationCode":"// Pre-check the issue satisfies common create constraints:\nfunc canCreate(issue *types.Issue) error {\n    if issue.Title == \"\" {\n        return fmt.Errorf(\"%s: empty title\", issue.ID)\n    }\n    if issue.ExternalRef != \"\" {\n        return fmt.Errorf(\"%s: already linked to %s; not a create\", issue.ID, issue.ExternalRef)\n    }\n    return nil\n}","typeGuard":"func isRateLimited(err error) bool { return isRateLimitedErr(err) } // stop pushing and wait instead of hammering creates","tryCatchPattern":"stats, err := engine.Sync(ctx, opts)\nif err != nil {\n    // only rate-limit exhaustion aborts with an error here\n    if strings.Contains(err.Error(), \"sync aborted\") {\n        waitUntilRateLimitReset()\n        stats, err = engine.Sync(ctx, opts)\n    }\n    return err\n}\n// per-issue create failures: check stats.Errors + stats.Warnings, fix, re-push","preventionTips":["Throttle create-heavy syncs to respect tracker rate limits.","Ensure required remote fields (Jira mandatory fields, GitHub repo write access) are mapped before first push.","Keep titles/descriptions within tracker limits (truncate or map long text to the description body).","Re-push after failures — successfully created issues skip on the next run via external_ref/push hashes."],"tags":["sync","push","create-issue","tracker-adapter"],"backgroundTag":"tracker-issue-create-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}