{"record":{"id":"eb2a4d2b9709e024","repo":"nexu-io/open-design","slug":"volcengine-video-fetch-dlresp-status","errorCode":null,"errorMessage":"volcengine video fetch ${dlResp.status}","messagePattern":"volcengine video fetch (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/index.ts","lineNumber":1519,"sourceCode":"    if (typeof onProgress === 'function') {\n      const elapsedSec = Math.round((Date.now() - startedAt) / 1000);\n      onProgress(`volcengine task ${taskId} status=${lastStatus || 'pending'} (elapsed ${elapsedSec}s)`);\n    }\n    if (lastStatus === 'succeeded') {\n      videoUrl = pollData?.content?.video_url || null;\n      break;\n    }\n    if (lastStatus === 'failed' || lastStatus === 'cancelled') {\n      const reason = pollData?.error?.message || lastStatus;\n      throw new Error(`volcengine task ${lastStatus}: ${reason}`);\n    }\n  }\n  if (!videoUrl) {\n    throw new Error(`volcengine task did not finish in time (last status: ${lastStatus || 'unknown'})`);\n  }\n\n  const dlResp = await fetch(videoUrl, withMediaRequestInit(ctx));\n  if (!dlResp.ok) throw new Error(`volcengine video fetch ${dlResp.status}`);\n  const arr = await dlResp.arrayBuffer();\n  const bytes = Buffer.from(arr);\n\n  return {\n    bytes,\n    providerNote: `volcengine/${ctx.wireModel} · ${ratio} · ${durationSec}s · ${bytes.length} bytes`,\n    suggestedExt: '.mp4',\n  };\n}\n\nfunction volcengineRatioFor(aspect?: string): string {\n  // Seedance accepts a fixed list of ratios; map the OD vocabulary to\n  // its canonical strings.\n  if (!aspect) return '16:9';\n  if (aspect === '1:1' || aspect === '16:9' || aspect === '9:16' || aspect === '4:3' || aspect === '3:4') {\n    return aspect;\n  }\n  return '16:9';","sourceCodeStart":1501,"sourceCodeEnd":1537,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/index.ts#L1501-L1537","documentation":"Thrown when downloading the produced video bytes from the temporary `video_url` Volcengine returned fails (`!dlResp.ok`). The temp URL is only valid ~24h, so the dispatcher streams bytes immediately; a non-2xx here usually means the URL expired, the CDN errored, or access was revoked.","triggerScenarios":"`dlResp.ok === false` on the `GET videoUrl` after the task succeeded. Causes: the signed/expiring URL already invalidated (rare within the same render), the object-storage CDN returned a transient 5xx, or a network/proxy blocked the object-storage host.","commonSituations":"(1) Object-storage CDN transient 5xx; (2) network policy blocking the Volcengine CDN domain; (3) unusually long delay between task success and download (paused process, clock skew).","solutions":["Retry the render; the download step is idempotent against transient CDN errors.","Ensure the Volcengine object-storage/CDN host is reachable from the daemon host.","If persistent, check whether the region's storage endpoint is allowlisted."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// The succeeded task id is useless once the URL fetch fails — retry the whole render.\ntry { return await renderVolcengineVideo(ctx, credentials, onProgress); }\ncatch (err) {\n  const msg = err instanceof Error ? err.message : String(err);\n  if (/video fetch 5\\d{2}/.test(msg)) { return await renderVolcengineVideo(ctx, credentials, onProgress); }\n  throw err;\n}","preventionTips":["Treat CDN download failures as transient and retry.","Allowlist the Volcengine object-storage/CDN host on restricted networks.","Avoid pausing the process between task success and the download step."],"tags":["volcengine","ark","seedance","video","download"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}