{"record":{"id":"2917f52245bba655","repo":"gitroomhq/postiz-app","slug":"video-generation-succeeded-but-no-video-url-return","errorCode":null,"errorMessage":"Video generation succeeded but no video URL returned","messagePattern":"Video generation succeeded but no video URL returned","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"libraries/nestjs-libraries/src/videos/veo3/veo3.ts","lineNumber":107,"sourceCode":"        throw new Error(data?.msg || `Failed to get video info`);\n      }\n\n      // successFlag: 0 = generating, 1 = success, anything else = failed\n      const successFlag = data?.data?.successFlag;\n      if (successFlag !== 0 && successFlag !== 1) {\n        throw new Error(\n          data?.data?.errorMessage ||\n            `Video generation failed (status ${successFlag})`\n        );\n      }\n\n      const videoUrl = data?.data?.response?.resultUrls || [];\n      if (videoUrl.length > 0) {\n        return videoUrl[0];\n      }\n\n      if (successFlag === 1) {\n        throw new Error('Video generation succeeded but no video URL returned');\n      }\n\n      await timer(10000);\n    }\n  }\n}\n","sourceCodeStart":89,"sourceCodeEnd":114,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/videos/veo3/veo3.ts#L89-L114","documentation":"After the loop confirms successFlag===1 (success), it expects data.data.response.resultUrls to be non-empty. If the provider marks the task successful but returns no result URLs, this error is thrown — a provider contract violation or partially corrupted response.","triggerScenarios":"Provider marks task done but resultUrls is missing, null, or an empty array; response shape changed after a provider API update; race where the record is marked success before URLs are attached.","commonSituations":"kie.ai API version changes renaming the response field; expired/deleted result artifacts; rare provider bug.","solutions":["Log the full data payload when this fires to see the actual response shape","Re-poll once or twice after a short delay — the URL may be attached moments after the success flag","If the field was renamed upstream, update the resultUrls path in veo3.ts","Fall back to re-generating the video"],"exampleFix":"// before\nif (successFlag === 1) {\n  throw new Error('Video generation succeeded but no video URL returned');\n}\n\n// after\nif (successFlag === 1) {\n  await timer(10000); // one re-check for late-attached URLs\n  const recheck = await pollOnce(taskId);\n  const url = recheck?.data?.response?.resultUrls?.[0];\n  if (url) return url;\n  throw new Error('Video generation succeeded but no video URL returned');\n}","handlingStrategy":"fallback","validationCode":"const hasResultUrl = (d: any): boolean => Array.isArray(d?.data?.response?.resultUrls) && d.data.response.resultUrls.length > 0;","typeGuard":"const hasResultUrl = (d: any): boolean => Array.isArray(d?.data?.response?.resultUrls) && d.data.response.resultUrls.length > 0;","tryCatchPattern":"try { await veo3.process(prompt); } catch (e) { if (/no video URL returned/.test(String(e))) { await sleep(10000); return veo3.process(prompt); } throw e; }","preventionTips":["Re-check once for late-attached URLs before failing","Log full provider payloads on contract mismatches","Pin provider API versions where possible"],"tags":["veo3","video-generation","api-contract","upstream"],"backgroundTag":"empty-upstream-response","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}