{"record":{"id":"4316ee2b003ccb05","repo":"calesthio/OpenMontage","slug":"prerequisite-violation-stage-stage-r-cannot-adv","errorCode":null,"errorMessage":"PREREQUISITE VIOLATION: stage {stage!r} cannot advance; {details}. Pipeline order: {stages}.","messagePattern":"PREREQUISITE VIOLATION: stage (.+?) cannot advance; (.+?)\\. Pipeline order: (.+?)\\.","errorType":"validation","errorClass":"CheckpointValidationError","httpStatus":null,"severity":"error","filePath":"lib/checkpoint.py","lineNumber":342,"sourceCode":"            or checkpoint.get(\"stage\") != predecessor\n        ):\n            incomplete.append(predecessor)\n            continue\n        if checkpoint.get(\"status\") != \"completed\":\n            incomplete.append(predecessor)\n            continue\n        if _stage_requires_approval(pipeline_type, predecessor) and not checkpoint.get(\n            \"human_approved\"\n        ):\n            unapproved.append(predecessor)\n\n    if incomplete or unapproved:\n        details = []\n        if incomplete:\n            details.append(f\"incomplete or missing: {incomplete}\")\n        if unapproved:\n            details.append(f\"completed without required approval: {unapproved}\")\n        raise CheckpointValidationError(\n            f\"PREREQUISITE VIOLATION: stage {stage!r} cannot advance; \"\n            + \"; \".join(details)\n            + f\". Pipeline order: {stages}.\"\n        )\n\n\ndef _archive_superseded_checkpoint(path: Path, stage: str) -> None:\n    \"\"\"Copy an existing checkpoint into history/ before it is overwritten.\n\n    Preserves the full run record: stage re-runs (script v1 → v2) and gate\n    transitions (awaiting_human → completed) remain reconstructable. Repeated\n    in_progress refreshes are NOT archived — they are partial-progress\n    heartbeats, not versions.\n\n    Archiving is best-effort and must never crash a checkpoint write: the\n    Backlot watcher may hold the file open (Windows denies renames of open\n    files), so we copy rather than move, and swallow archival I/O failures.\n    \"\"\"","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/lib/checkpoint.py#L324-L360","documentation":"_validate_optional_parameters checks callback_url when present and requires it to start with https:// or http://. Ark calls this URL when the async video task completes; anything else (asset:// , data:, ftp:, bare hostnames) is rejected before submission.","triggerScenarios":"callback_url=\"events.example.com/hook\", callback_url=\"asset://cb\", callback_url=\"file:///tmp/hook\" in the optional parameters.","commonSituations":"Config templates omitting the scheme; local dev with localhost used without http://; webhook URLs loaded from env vars that include quotes or whitespace.","solutions":["Include the scheme: http://localhost:9000/hook locally or https://your-host/webhook in production.","Strip quotes/whitespace from env-provided callback URLs.","Omit callback_url entirely if you poll for completion instead."],"exampleFix":"# before\npayload = {\"callback_url\": \"events.example.com/hook\"}\n# after\npayload = {\"callback_url\": \"https://events.example.com/hook\"}","handlingStrategy":"validation","validationCode":"def callback_ok(url) -> bool:\n    return url is None or str(url).startswith((\"http://\", \"https://\"))","typeGuard":"def is_http_url(v) -> bool:\n    return str(v).startswith((\"http://\", \"https://\"))","tryCatchPattern":"try:\n    tool.run(inputs)\nexcept ValueError as e:\n    if \"callback_url\" in str(e):\n        payload[\"callback_url\"] = \"https://\" + payload[\"callback_url\"].lstrip(\"/\")\n        tool.run(inputs)\n    else:\n        raise","preventionTips":["Normalize webhook URLs (add scheme, strip whitespace) when loading config.","For local dev use http://localhost:PORT — the scheme is what matters, not reachability."],"tags":["python","validation","callback","url","webhook","seedance"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}