{"record":{"id":"e2a178f046f9b797","repo":"nexu-io/open-design","slug":"volcengine-task-create-taskresp-status-trunc","errorCode":null,"errorMessage":"volcengine task create ${taskResp.status}: ${truncate(taskText, 240)}","messagePattern":"volcengine task create (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/index.ts","lineNumber":1449,"sourceCode":"    });\n  }\n\n  const taskBody = {\n    model: ctx.wireModel,\n    content,\n  };\n\n  const taskResp = await fetch(`${baseUrl}/contents/generations/tasks`, withMediaRequestInit(ctx, {\n    method: 'POST',\n    headers: {\n      'authorization': `Bearer ${credentials.apiKey}`,\n      'content-type': 'application/json',\n    },\n    body: JSON.stringify(taskBody),\n  }));\n  const taskText = await taskResp.text();\n  if (!taskResp.ok) {\n    throw new Error(`volcengine task create ${taskResp.status}: ${truncate(taskText, 240)}`);\n  }\n  let taskData: any;\n  try {\n    taskData = JSON.parse(taskText);\n  } catch {\n    throw new Error(`volcengine non-JSON: ${truncate(taskText, 200)}`);\n  }\n  const taskId = taskData && taskData.id;\n  if (!taskId) throw new Error('volcengine task response missing id');\n\n  // Poll until succeeded/failed. Keep a hard cap, but make it long\n  // enough for real Seedance queues: fast t2v often returns in 30-120s,\n  // while i2v and busy-region t2v can exceed the old 6-minute ceiling.\n  const startedAt = Date.now();\n  const configuredMaxMs = Number(process.env.OD_VOLCENGINE_VIDEO_MAX_POLL_MS);\n  const maxMs =\n    Number.isFinite(configuredMaxMs) && configuredMaxMs >= 60_000\n      ? configuredMaxMs","sourceCodeStart":1431,"sourceCodeEnd":1467,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/index.ts#L1431-L1467","documentation":"Thrown when the Seedance task-creation `POST /api/v3/contents/generations/tasks` returns a non-2xx status. The message includes the HTTP status and up to 240 chars of the body, surfacing Volcengine's JSON error (auth, quota, model-not-enabled, invalid params).","triggerScenarios":"`taskResp.ok === false` on creation. Concretely: 401 from a wrong/expired ARK key, 403/permission-denied because the Seedance model isn't activated for the account, 400 from an unsupported `--resolution`/`--ratio`/`--duration` flag combination, or 429 quota exhaustion.","commonSituations":"(1) ARK key valid but the specific Doubao Seedance model not subscribed/activated in the Volcengine console; (2) ratio/duration/resolution combination Seedance rejects; (3) account out of video-generation quota; (4) `baseUrl` overridden to a region that doesn't host the model.","solutions":["Inspect the embedded status+body: 401 → fix key; 403/'permission denied' → enable the Seedance model in the Volcengine console under inference access; 400 → adjust aspect/duration; 429 → wait for quota reset.","Ensure `ctx.wireModel` matches an activated Ark endpoint id (e.g. `ep-xxxx`) or model name.","If using a custom `baseUrl`, confirm it's the correct regional Ark host (`ark.cn-beijing.volces.com`)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await renderVolcengineVideo(ctx, credentials, onProgress);\n} catch (err) {\n  const msg = err instanceof Error ? err.message : String(err);\n  if (/task create 429/.test(msg)) { /* quota — do not retry immediately */ }\n  if (/task create 40[13]/.test(msg)) { throw new Error('Volcengine auth failed — check ARK_API_KEY'); }\n  if (/permission|forbidden/i.test(msg)) { throw new Error('Seedance model not activated for this account'); }\n  throw err;\n}","preventionTips":["Activate the exact Seedance model in the Volcengine console before first use.","Validate that `ctx.wireModel` is an Ark endpoint id (`ep-...`) or a subscribed model name.","Keep ratio/duration/resolution within Seedance's documented matrix."],"tags":["volcengine","ark","seedance","video","provider-error"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}