{"record":{"id":"e0626b7e5597a2ac","repo":"paperclipai/paperclip","slug":"migrator-producers-failed-failures-join","errorCode":null,"errorMessage":"Migrator producers failed: ${failures.join(\", \")}.","messagePattern":"Migrator producers failed: (.+?)\\.","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/cloud-readiness.mjs","lineNumber":38,"sourceCode":"    });\n    if (!response.ok) throw new Error(`Migrator producer lookup failed: HTTP ${response.status}`);\n    const body = await response.json();\n    if (!Array.isArray(body.workflow_runs) || !Number.isSafeInteger(body.total_count) || body.total_count < 0 ||\n        (page === 1 && (body.total_count === 0) !== (body.workflow_runs.length === 0))) throw new Error(\"Invalid migrator producer response.\");\n    if (body.total_count === 0) return false;\n    for (const run of body.workflow_runs) {\n      if (run.head_sha !== sha || run.head_branch !== \"master\" || run.path !== workflow ||\n          run.head_repository?.id !== 1170821064 || run.head_repository.full_name !== repository ||\n          ![\"push\", \"workflow_dispatch\"].includes(run.event)) throw new Error(\"Migrator producer identity mismatch.\");\n      // Publication is immutable. A later failed manual run must not hide a\n      // successful exact-source publisher; the signed bundle is checked next.\n      if (run.status === \"completed\" && run.conclusion === \"success\") return true;\n      if (run.status !== \"completed\") pending = true;\n      else failures.push(`${run.id}: ${run.conclusion}`);\n    }\n    if (page * 100 >= body.total_count) {\n      if (pending) return false;\n      throw new Error(`Migrator producers failed: ${failures.join(\", \")}.`);\n    }\n  }\n  throw new Error(\"Too many migrator producer runs to establish publication.\");\n}\n\nexport function verifyManifestProvenance(bytes, sha, { exec = execFileSync } = {}) {\n  versionFor(sha);\n  const scratch = mkdtempSync(path.join(os.tmpdir(), \"cloud-readiness-attestation-\"));\n  try {\n    const file = path.join(scratch, \"manifest.json\");\n    writeFileSync(file, bytes);\n    exec(\"gh\", [\"attestation\", \"verify\", file, \"--repo\", repository,\n      \"--source-digest\", sha, \"--source-ref\", \"refs/heads/master\",\n      \"--cert-identity\", `https://github.com/${repository}/${workflow}@refs/heads/master`,\n      \"--deny-self-hosted-runners\"], { stdio: \"inherit\", timeout: 60_000 });\n  } finally { rmSync(scratch, { recursive: true, force: true }); }\n}\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/scripts/cloud-readiness.mjs#L20-L56","documentation":"When all pages of migrator runs have been examined, none are pending, and none succeeded, the script throws listing the failed run ids and conclusions. Publication is fail-closed: a failed publisher run blocks rather than silently waiting.","triggerScenarios":"Every completed cloud-migrator-artifacts run for the SHA on master ended with a failure/cancelled conclusion (e.g. build or publish job failed) and no run is still in progress.","commonSituations":"The publish job failed on S3 upload (missing AWS credentials), the bundle validation failed on a bad package tarball, or someone cancelled the run; a manual workflow_dispatch rerun failed after an earlier failure.","solutions":["Read the failure list (runId: conclusion) and open the corresponding GitHub Actions run to find the failing step.","Fix the underlying build/publish failure (npm pack output, AWS credentials on the publish job, bundle validation) and re-run the workflow on the same SHA.","Note: if an earlier run for the same SHA succeeded, that success is honored and this error will not throw — only SHA-level total failure reaches this path."],"exampleFix":"// before\n// no run for sha, or all failed\n// after\ngh workflow run cloud-migrator-artifacts.yml --ref master -f sha=<sha>  # then let readiness poll again","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await waitForCloudArtifacts(sha);\n} catch (error) {\n  const m = error.message.match(/^Migrator producers failed: (.*)\\.$/);\n  if (m) {\n    for (const entry of m[1].split(\", \")) {\n      const [runId, conclusion] = entry.split(\": \");\n      console.error(`See https://github.com/paperclipai/paperclip/actions/runs/${runId} (${conclusion})`);\n    }\n    process.exitCode = 1;\n  } else throw error;\n}","preventionTips":["Watch the migrator workflow after each master push","Give the publish job valid AWS credentials so uploads do not fail","Fail the PR pipeline early if the publish job fails instead of retrying blindly"],"tags":["github-actions","ci-failure"],"backgroundTag":"http-error-response","analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}