{"record":{"id":"c6db9e37b5fd1c81","repo":"decolua/9router","slug":"deploy-timed-out-after-60-seconds","errorCode":null,"errorMessage":"Deploy timed out after 60 seconds","messagePattern":"Deploy timed out after 60 seconds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/app/api/proxy-pools/deno-deploy/route.js","lineNumber":134,"sourceCode":"      await fetch(`${DENO_V2_API}/apps/${app.id}`, {\n        method: \"DELETE\",\n        headers: { Authorization: `Bearer ${denoToken}` },\n      }).catch(() => {});\n      return NextResponse.json(\n        { error: `Deploy failed (${deployRes.status}): ${text}` },\n        { status: deployRes.status }\n      );\n    }\n\n    const revision = await deployRes.json();\n    const revisionId = revision.id;\n\n    let status = revision.status;\n    let attempts = 0;\n    const maxAttempts = 30; // 30 * 2s = 60s max\n    while (status === \"queued\" || status === \"building\") {\n      if (attempts >= maxAttempts) {\n        throw new Error(\"Deploy timed out after 60 seconds\");\n      }\n      await new Promise((resolve) => setTimeout(resolve, 2000));\n      const statusRes = await fetch(`${DENO_V2_API}/revisions/${revisionId}`, {\n        headers: { Authorization: `Bearer ${denoToken}` },\n      });\n      if (!statusRes.ok) break;\n      const statusData = await statusRes.json();\n      status = statusData.status;\n      attempts++;\n    }\n\n    if (status !== \"succeeded\") {\n      await fetch(`${DENO_V2_API}/apps/${app.id}`, {\n        method: \"DELETE\",\n        headers: { Authorization: `Bearer ${denoToken}` },\n      }).catch(() => {});\n      return NextResponse.json(\n        { error: `Deploy failed with status: ${status}` },","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/decolua/9router/blob/90b52e06ffd666b7929554211474d01588f6b1f8/src/app/api/proxy-pools/deno-deploy/route.js#L116-L152","documentation":"After creating a Deno Deploy revision, the route polls its status every 2 seconds, at most 30 attempts (60s). If the revision is still 'queued' or 'building' after that window, the deploy is abandoned with this timeout error rather than blocking the request indefinitely.","triggerScenarios":"POST to /api/proxy-pools/deno-deploy where the Deno Deploy build takes longer than 60 seconds (large project, cold build queue, slow assets), leaving status stuck at queued/building for 30 polls.","commonSituations":"Deno Deploy platform congestion or incident causing long build queues; an unusually large deployment; a revision that silently stalls in 'building' due to a build error that never flips the status.","solutions":["Retry the deploy — transient queue congestion often resolves.","Check the revision on dash.deno.com for build logs/errors if it consistently stalls.","Shrink the deployed project (fewer/simpler files) so the build completes within 60s.","If timeouts are frequent, check Deno Deploy status page for ongoing incidents and consider raising maxAttempts in the route."],"exampleFix":"// before\nconst maxAttempts = 30; // 60s max\n// after\nconst maxAttempts = 90; // tolerate slower builds (180s)","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await deployToDeno(config);\n} catch (e) {\n  if (e.message.includes(\"Deploy timed out\")) {\n    console.warn(\"Build exceeded 60s — retrying deploy\");\n    await deployToDeno(config); // queue congestion often clears\n  } else throw e;\n}","preventionTips":["Retry the deploy once before investigating — build queues fluctuate","Keep deployed projects small so builds finish within 60s","Check dash.deno.com revision logs when the same deploy times out repeatedly","Monitor Deno Deploy status during platform incidents"],"tags":["timeout","deployment","deno"],"backgroundTag":"deploy-timeout","analyzedSha":"90b52e06ffd666b7929554211474d01588f6b1f8","analyzedAt":"2026-08-30T21:05:45.952Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}