calesthio/OpenMontage · error · RuntimeError

Seedream submit succeeded but did not return request_id

Error message

Seedream submit succeeded but did not return request_id

What it means

Raised when the Seedream submit POST to the fal.run queue endpoint returns HTTP success but the JSON body has no 'request_id'. The queue protocol requires a request id to build the status/result URLs, so without it the tool cannot poll and aborts. Usually indicates an auth/billing response shape, a gateway page, or an API contract change rather than a generation failure.

Source

Thrown at tools/graphics/seedream_image.py:194

        }

        try:
            headers = {
                "Authorization": f"Key {api_key}",
                "Content-Type": "application/json",
            }

            submit_resp = requests.post(
                submit_url,
                headers=headers,
                json=payload,
                timeout=(10, 60),
            )
            submit_resp.raise_for_status()
            submit_data = submit_resp.json()
            request_id = submit_data.get("request_id")
            if not request_id:
                raise RuntimeError(
                    "Seedream submit succeeded but did not return request_id"
                )
            status_url = (
                f"https://queue.fal.run/bytedance/seedream/requests/"
                f"{request_id}/status"
            )
            elapsed = 0.0
            while elapsed < 300:
                status_resp = requests.get(
                    status_url,
                    headers=headers,
                    timeout=30,
                )
                status_resp.raise_for_status()
                status_data = status_resp.json()
                status = status_data.get("status")

                if status == "COMPLETED":

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Print submit_data to see what actually came back (error message, HTML, empty dict)
  2. Verify FAL_KEY is valid and the account has Seedream access
  3. Confirm the submit_url and expected response schema against current fal.run queue docs
  4. Retry once — transient gateway 200-with-error bodies do occur

Example fix

// before
submit_data = submit_resp.json()
request_id = submit_data.get("request_id")
// after
submit_data = submit_resp.json()
request_id = submit_data.get("request_id") or submit_data.get("requestId")
if not request_id and "error" in submit_data:
    raise RuntimeError(f"Seedream submit rejected: {submit_data['error']}")
Defensive patterns

Strategy: retry

Validate before calling

# nothing caller-side can fully prevent a 200-without-request_id;
# verify credentials first
import os
assert os.environ.get("FAL_KEY"), "valid FAL_KEY required before seedream submit"

Try / catch

for attempt in range(2):
    try:
        return seedream_run(inputs)
    except RuntimeError as e:
        if "did not return request_id" in str(e) and attempt == 0:
            continue  # transient gateway body; retry once
        raise

Prevention

When it happens

Trigger: FAL_KEY invalid/expired so the endpoint returns a 200 HTML or JSON error body; fal.run queue API changed its response key; a proxy intercepts the request and returns success with an empty body.

Common situations: Rotated fal.ai credentials; environment-specific egress proxies; API version drift on queue.fal.run.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/53166a2b4bbf50ae. Report an issue: GitHub.