decolua/9router · error

Runway task failed

Error message

Runway task failed

What it means

While polling an async Runway image/video generation task, the task reached terminal status FAILED or CANCELLED and no upstream `failure` reason string was present in the status payload, so this generic message is thrown. It means Runway itself rejected or aborted the generation — the request reached Runway fine, but the work did not produce output.

Source

Thrown at open-sse/handlers/imageProviders/runwayml.js:40

    const isVideo = !model.includes("image");
    const ratio = sizeToAspectRatio(body.size);
    if (isVideo) {
      return { promptText: body.prompt, model, ratio, duration: 5, ...(body.image ? { promptImage: body.image } : {}) };
    }
    return { promptText: body.prompt, model, ratio, ...(body.image ? { referenceImages: [{ uri: body.image }] } : {}) };
  },
  async parseResponse(response, { headers }) {
    const { id } = await response.json();
    if (!id) throw new Error("Runway: no task id returned");
    const taskUrl = `${BASE_URL}/tasks/${id}`;
    const deadline = Date.now() + POLL_TIMEOUT_MS;
    while (Date.now() < deadline) {
      await sleep(POLL_INTERVAL_MS);
      const r = await fetch(taskUrl, { headers });
      if (!r.ok) throw new Error(`Runway status ${r.status}`);
      const s = await r.json();
      if (s.status === "SUCCEEDED") return s;
      if (s.status === "FAILED" || s.status === "CANCELLED") throw new Error(s.failure || "Runway task failed");
    }
    throw new Error("Runway polling timeout");
  },
  normalize: (responseBody) => {
    const outputs = Array.isArray(responseBody.output) ? responseBody.output : [];
    return { created: nowSec(), data: outputs.map((url) => ({ url })) };
  },
};

View on GitHub (pinned to 90b52e06ff)

Solutions

  1. Log the full task status JSON (fetch `${BASE_URL}/tasks/{id}` manually with the same Bearer token) to see the real `failure`/`status` details Runway returned
  2. Review the prompt and any reference image for content-policy or format issues (unsupported ratio, oversized image URL) and resubmit
  3. Verify the Runway account has credits/quota and the API key is active for the model used (gen4_image or video model)
  4. Retry the generation — transient infra failures on Runway's side can also mark a task CANCELLED

Example fix

// before — reason is lost when s.failure is absent
if (s.status === "FAILED" || s.status === "CANCELLED") throw new Error(s.failure || "Runway task failed");
// after — preserve full upstream context
if (s.status === "FAILED" || s.status === "CANCELLED") {
  throw new Error(`Runway task ${s.status}: ${s.failure || JSON.stringify(s).slice(0, 500)}`);
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const result = await runwayImageCall(params);
} catch (err) {
  if (err.message === "Runway task failed") {
    // upstream rejected the generation — surface to user as a retryable/contract issue,
    // inspect s.failure via task endpoint; do NOT retry with identical prompt blindly
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: parseResponse's poll loop (`GET {BASE_URL}/tasks/{id}`) reads `s.status === "FAILED" || s.status === "CANCELLED"` and `s.failure` is undefined/null, so the fallback message is used instead of a specific reason.

Common situations: Content-policy rejection of the prompt or reference image; unsupported aspect-ratio/model/duration combination in the submitted task; account out of credits so Runway cancels the task; Runway returning a failure payload without the `failure` field; using image_to_video with an invalid promptImage URL.

Related errors


AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30). Data as JSON: /api/errors/b93129721c6d1717. Report an issue: GitHub.