paperclipai/paperclip · error · Error

Too many migrator producer runs to establish publication.

Error message

Too many migrator producer runs to establish publication.

What it means

migratorPublished() pages through workflow runs with per_page=100 up to 10 pages (1000 runs max). If total_count exceeds that and no success/pending/failed conclusion was reached in those pages, it throws this overflow error rather than making an unbounded trust decision.

Solutions

  1. Find the successful run via the GitHub UI/API filtered by head_sha and confirm publication; the error means the paging cap was hit, not that publication failed.
  2. Reduce run volume: stop the retry loop dispatching the workflow, then rerun readiness.
  3. Increase the page cap (page <= 10) in scripts/cloud-readiness.mjs if legitimate volume genuinely exceeds 1000 runs.

Example fix

// before
for (let page = 1; page <= 10; page++) {
// after
for (let page = 1; page <= 20; page++) { // raise cap if runs legitimately exceed 1000
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await waitForCloudArtifacts(sha);
} catch (error) {
  if (error.message === "Too many migrator producer runs to establish publication.") {
    console.error(">1000 runs for this SHA and none succeeded — stop retry loops and publish once.");
    process.exitCode = 1;
  } else throw error;
}

Prevention

When it happens

Trigger: More than 1000 cloud-migrator-artifacts workflow runs exist for the exact head_sha on master with no successful run found in the first 10 pages.

Common situations: A runaway automation repeatedly dispatching the migrator workflow on the same commit (hundreds of retries), combined with no successful publication; pathological CI retry loops.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18). Data as JSON: /api/errors/5e7153add089e653. Report an issue: GitHub.

Appendix: source

Thrown at scripts/cloud-readiness.mjs:41

    if (!Array.isArray(body.workflow_runs) || !Number.isSafeInteger(body.total_count) || body.total_count < 0 ||
        (page === 1 && (body.total_count === 0) !== (body.workflow_runs.length === 0))) throw new Error("Invalid migrator producer response.");
    if (body.total_count === 0) return false;
    for (const run of body.workflow_runs) {
      if (run.head_sha !== sha || run.head_branch !== "master" || run.path !== workflow ||
          run.head_repository?.id !== 1170821064 || run.head_repository.full_name !== repository ||
          !["push", "workflow_dispatch"].includes(run.event)) throw new Error("Migrator producer identity mismatch.");
      // Publication is immutable. A later failed manual run must not hide a
      // successful exact-source publisher; the signed bundle is checked next.
      if (run.status === "completed" && run.conclusion === "success") return true;
      if (run.status !== "completed") pending = true;
      else failures.push(`${run.id}: ${run.conclusion}`);
    }
    if (page * 100 >= body.total_count) {
      if (pending) return false;
      throw new Error(`Migrator producers failed: ${failures.join(", ")}.`);
    }
  }
  throw new Error("Too many migrator producer runs to establish publication.");
}

export function verifyManifestProvenance(bytes, sha, { exec = execFileSync } = {}) {
  versionFor(sha);
  const scratch = mkdtempSync(path.join(os.tmpdir(), "cloud-readiness-attestation-"));
  try {
    const file = path.join(scratch, "manifest.json");
    writeFileSync(file, bytes);
    exec("gh", ["attestation", "verify", file, "--repo", repository,
      "--source-digest", sha, "--source-ref", "refs/heads/master",
      "--cert-identity", `https://github.com/${repository}/${workflow}@refs/heads/master`,
      "--deny-self-hosted-runners"], { stdio: "inherit", timeout: 60_000 });
  } finally { rmSync(scratch, { recursive: true, force: true }); }
}

/** Read-only availability gate. Deployment still resolves and pins artifacts. */
export async function waitForCloudArtifacts(sha, {
  fetchImpl = fetch,

View on GitHub (pinned to 3f1d897a7c)