MiniMax-AI/skills · error · SystemExit

Generation incomplete (status={status}): {json.dumps(data, i

Error message

Generation incomplete (status={status}): {json.dumps(data, indent=2)}

What it means

music_generation returned base_resp.status_code 0 (no API error) but data.data.status is not 2. The script treats status==2 as the only success value; any other status means the track did not finish successfully in this synchronous call, and the full JSON is dumped for diagnosis.

Source

Thrown at skills/frontend-dev/scripts/minimax_music.py:83

        f"{API_BASE}/music_generation",
        headers={
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json",
        },
        json=payload,
        timeout=timeout,
    )
    resp.raise_for_status()
    data = resp.json()

    # Check API-level error
    base_resp = data.get("base_resp", {})
    if base_resp.get("status_code", 0) != 0:
        raise SystemExit(f"API Error [{base_resp.get('status_code')}]: {base_resp.get('status_msg')}")

    status = data.get("data", {}).get("status")
    if status != 2:
        raise SystemExit(f"Generation incomplete (status={status}): {json.dumps(data, indent=2)}")

    audio_data = data.get("data", {}).get("audio", "")
    if not audio_data:
        raise SystemExit(f"No audio in response: {json.dumps(data, indent=2)}")

    extra = data.get("extra_info", {})

    if output_format == "hex":
        audio_bytes = bytes.fromhex(audio_data)
    else:
        # URL mode — audio_data is a URL string
        audio_bytes = None

    return {
        "audio_bytes": audio_bytes,
        "audio_url": audio_data if output_format == "url" else None,
        "duration": extra.get("music_duration"),
        "sample_rate": extra.get("music_sample_rate"),

View on GitHub (pinned to 60aaae52bb)

Solutions

  1. Inspect the dumped JSON — confirm the numeric status and any accompanying message field to know if it is transient or terminal.
  2. Retry the identical request once or twice with a short delay; a non-2 but non-failure status often clears.
  3. If it persists, simplify the request (drop lyrics_optimizer, switch model to music-2.5, lower sample_rate) to isolate the trigger.
  4. Check the MiniMax status page / dashboard for an ongoing incident if many requests return the same non-2 status.

Example fix

// before: single shot, hard fail
if status != 2:
    raise SystemExit(f"Generation incomplete (status={status})")

// after: bounded retry for transient non-2 status
for attempt in range(3):
    data = post(payload)
    status = data.get("data", {}).get("status")
    if status == 2:
        break
    time.sleep(5 * (attempt + 1))
else:
    raise RuntimeError(f"Generation never reached status=2 (last={status})")
Defensive patterns

Strategy: retry

Validate before calling

import requests, time

def generate_music_until_done(payload, attempts=3, delay=5):
    for i in range(attempts):
        data = requests.post(f"{API_BASE}/music_generation", json=payload, timeout=600).json()
        if data.get("base_resp", {}).get("status_code", 0) != 0:
            raise RuntimeError(data["base_resp"])
        status = data.get("data", {}).get("status")
        if status == 2:
            return data
        time.sleep(delay * (i + 1))
    raise RuntimeError(f"music never reached status=2 (last={status})")

Type guard

def is_terminal_music_status(status) -> bool:
    """status==2 is success; treat other known terminal values as non-retryable."""
    return status == 2  # extend set as the API documents more terminal codes

Try / catch

import subprocess, sys, time
for attempt in range(3):
    r = subprocess.run([sys.executable, "minimax_music.py", "--prompt", p, "-o", out], capture_output=True, text=True)
    if r.returncode == 0:
        break
    if "Generation incomplete" in (r.stderr or r.stdout or ""):
        time.sleep(5 * (attempt + 1)); continue
    raise RuntimeError(r.stderr or r.stdout)
else:
    raise RuntimeError("music generation incomplete after retries")

Prevention

When it happens

Trigger: The endpoint returns a non-2 status (e.g. 1 processing, or a non-success terminal value) under backend load, when the chosen model/params cause a deferred result, or when an account-specific behavior makes the nominally-synchronous endpoint return an intermediate state.

Common situations: Backend congestion returning a still-processing status; a model variant that sometimes queues; regional endpoint behaving differently; transient generation hiccup where the track ultimately would succeed on retry.

Related errors


AI-assisted analysis of MiniMax-AI/skills@60aaae52bb (2026-08-13). Data as JSON: /api/errors/7bad03b58628c86c. Report an issue: GitHub.