gitroomhq/postiz-app · error · Error

Video generation succeeded but no video URL returned

Error message

Video generation succeeded but no video URL returned

What it means

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.

Source

Thrown at libraries/nestjs-libraries/src/videos/veo3/veo3.ts:107

        throw new Error(data?.msg || `Failed to get video info`);
      }

      // successFlag: 0 = generating, 1 = success, anything else = failed
      const successFlag = data?.data?.successFlag;
      if (successFlag !== 0 && successFlag !== 1) {
        throw new Error(
          data?.data?.errorMessage ||
            `Video generation failed (status ${successFlag})`
        );
      }

      const videoUrl = data?.data?.response?.resultUrls || [];
      if (videoUrl.length > 0) {
        return videoUrl[0];
      }

      if (successFlag === 1) {
        throw new Error('Video generation succeeded but no video URL returned');
      }

      await timer(10000);
    }
  }
}

View on GitHub (pinned to 0f1647f749)

Solutions

  1. Log the full data payload when this fires to see the actual response shape
  2. Re-poll once or twice after a short delay — the URL may be attached moments after the success flag
  3. If the field was renamed upstream, update the resultUrls path in veo3.ts
  4. Fall back to re-generating the video

Example fix

// before
if (successFlag === 1) {
  throw new Error('Video generation succeeded but no video URL returned');
}

// after
if (successFlag === 1) {
  await timer(10000); // one re-check for late-attached URLs
  const recheck = await pollOnce(taskId);
  const url = recheck?.data?.response?.resultUrls?.[0];
  if (url) return url;
  throw new Error('Video generation succeeded but no video URL returned');
}
Defensive patterns

Strategy: fallback

Validate before calling

const hasResultUrl = (d: any): boolean => Array.isArray(d?.data?.response?.resultUrls) && d.data.response.resultUrls.length > 0;

Type guard

const hasResultUrl = (d: any): boolean => Array.isArray(d?.data?.response?.resultUrls) && d.data.response.resultUrls.length > 0;

Try / catch

try { await veo3.process(prompt); } catch (e) { if (/no video URL returned/.test(String(e))) { await sleep(10000); return veo3.process(prompt); } throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: kie.ai API version changes renaming the response field; expired/deleted result artifacts; rare provider bug.

Related errors


AI-assisted analysis of gitroomhq/postiz-app@0f1647f749 (2026-08-27). Data as JSON: /api/errors/2917f52245bba655. Report an issue: GitHub.