gastownhall/beads · warning

Failed to create %s in %s: %v

Error message

Failed to create %s in %s: %v

What it means

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.

Source

Thrown at internal/tracker/engine.go:1081

			continue
		}

		// FormatDescription hook: apply to a copy so we don't mutate local data.
		pushIssue := issue
		if e.PushHooks != nil && e.PushHooks.FormatDescription != nil {
			copy := *issue
			copy.Description = e.PushHooks.FormatDescription(issue)
			pushIssue = &copy
		}

		if willCreate {
			// Create in external tracker
			created, err := e.Tracker.CreateIssue(ctx, pushIssue)
			if err != nil {
				if isRateLimitExhausted(err) {
					return stats, fmt.Errorf("sync aborted: %w", err)
				}
				e.warn("Failed to create %s in %s: %v", issue.ID, e.Tracker.DisplayName(), err)
				stats.Errors++
				if isRateLimitedErr(err) {
					e.warnRateLimitAbort(err, len(issues)-stats.Created-stats.Updated-stats.Skipped-stats.Errors)
					return stats, nil
				}
				continue
			}

			// Update local issue with external ref
			ref := e.Tracker.BuildExternalRef(created)
			updates := map[string]interface{}{"external_ref": ref}
			if err := e.Store.UpdateIssue(ctx, issue.ID, updates, e.Actor); err != nil {
				e.warn("Failed to update external_ref for %s: %v", issue.ID, err)
				stats.Errors++
				// Note: issue WAS created externally, so we still count Created
				// but also flag the error so the user knows the link is broken
			}
			// Surface any partial-success warnings from the create (e.g. a

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the %v cause: fix validation problems (shorten title, map required fields, create missing labels) and re-push the specific issue.
  2. If permission denied, grant the token/app write access to the target repository/project.
  3. If rate limited, wait for the reset window and re-run; unchanged issues skip via push hashes so only uncreated items retry.
  4. As a workaround, confirm whether the tracker adapter supports batch push — the batch path handles per-item errors more gracefully.

Example fix

// before: title exceeds tracker limit -> create rejected
issue.Title = strings.Repeat("detail ", 60)
// after
issue.Title = "Shorter compliant title" // then re-run bd push
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check the issue satisfies common create constraints:
func canCreate(issue *types.Issue) error {
    if issue.Title == "" {
        return fmt.Errorf("%s: empty title", issue.ID)
    }
    if issue.ExternalRef != "" {
        return fmt.Errorf("%s: already linked to %s; not a create", issue.ID, issue.ExternalRef)
    }
    return nil
}

Type guard

func isRateLimited(err error) bool { return isRateLimitedErr(err) } // stop pushing and wait instead of hammering creates

Try / catch

stats, err := engine.Sync(ctx, opts)
if err != nil {
    // only rate-limit exhaustion aborts with an error here
    if strings.Contains(err.Error(), "sync aborted") {
        waitUntilRateLimitReset()
        stats, err = engine.Sync(ctx, opts)
    }
    return err
}
// per-issue create failures: check stats.Errors + stats.Warnings, fix, re-push

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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