{"record":{"id":"c9f26a0e3d2df109","repo":"calesthio/OpenMontage","slug":"checkpoint-failed-schema-validation-exc-message","errorCode":null,"errorMessage":"Checkpoint failed schema validation: {exc.message}","messagePattern":"Checkpoint failed schema validation: (.+?)","errorType":"validation","errorClass":"CheckpointValidationError","httpStatus":null,"severity":"error","filePath":"lib/checkpoint.py","lineNumber":191,"sourceCode":"        else ALL_KNOWN_STAGES\n    )\n\n    if not isinstance(stage, str) or stage not in valid_stages:\n        raise CheckpointValidationError(\n            f\"Invalid stage: {stage!r} for pipeline {pipeline_type!r}. \"\n            f\"Valid stages: {sorted(valid_stages)}\"\n        )\n    if not isinstance(status, str):\n        raise CheckpointValidationError(f\"Invalid status: {status!r}\")\n    if not isinstance(artifacts, dict):\n        raise CheckpointValidationError(\"Checkpoint artifacts must be a dictionary\")\n\n    _validate_artifacts_for_stage(stage, status, artifacts)\n\n    try:\n        jsonschema.validate(instance=checkpoint, schema=_load_checkpoint_schema())\n    except jsonschema.ValidationError as exc:\n        raise CheckpointValidationError(f\"Checkpoint failed schema validation: {exc.message}\") from exc\n\n\ndef _checkpoint_path(pipeline_dir: Path, project_id: str, stage: str) -> Path:\n    return pipeline_dir / project_id / f\"checkpoint_{stage}.json\"\n\n\ndef init_project(\n    project_id: str,\n    *,\n    title: str,\n    pipeline_type: str,\n    pipeline_dir: Optional[Path] = None,\n    style_playbook: Optional[str] = None,\n) -> Path:\n    \"\"\"Initialize a project workspace with the canonical layout + marker file.\n\n    Creates projects/<project_id>/ with the standard subdirectories and writes\n    project.json — the marker the Backlot board uses to render a project's","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/lib/checkpoint.py#L173-L209","documentation":"ffprobe succeeded but the measured audio duration is outside 2–max_seconds (default 15): either shorter than 2 seconds or longer than 15. Note ffprobe failure paths produce duration=0, so an unprobeable file also surfaces here as 'too short', and a ValueError from float() lands in the probe-failure error instead.","triggerScenarios":"A 1s beep/wav as reference audio; a full 3-minute song passed as reference_audio; a corrupt file whose probe yields 0.","commonSituations":"Voice clips trimmed too aggressively; trying to seed audio style from a complete track instead of a short excerpt; format-mismatch files where ffprobe reports 0 duration.","solutions":["Trim the clip to 2–15 seconds: ffmpeg -i in.mp3 -ss 0 -t 10 out.mp3.","If duration reads 0, verify with ffprobe manually and re-mux/re-encode the container.","For longer audio, pass several short reference clips instead of one long one."],"exampleFix":"# before\ninputs = {\"reference_audio_path\": \"full_song.mp3\"}\n# after\n# run: ffmpeg -i full_song.mp3 -ss 30 -t 10 clip.mp3\ninputs = {\"reference_audio_path\": \"clip.mp3\"}","handlingStrategy":"validation","validationCode":"import subprocess\nout = subprocess.run([\"ffprobe\", \"-v\", \"error\", \"-show_entries\", \"format=duration\",\n                      \"-of\", \"default=noprint_wrappers=1:nokey=1\", ref],\n                     capture_output=True, text=True, check=True).stdout\ndur = float(out.strip())\nassert 2 <= dur <= 15, dur","typeGuard":"def audio_duration_ok(seconds: float) -> bool:\n    return 2 <= seconds <= 15","tryCatchPattern":"try:\n    tool.run(inputs)\nexcept ValueError as e:\n    if \"2 to\" in str(e) and \"seconds\" in str(e):\n        trim_to_range(ref)  # ffmpeg -ss/-t to 2-15s, retry\n    else:\n        raise","preventionTips":["Trim reference audio to a fixed 5-10s excerpt at ingest.","Treat a probe result of 0.0 as a corrupt-file signal, not a short clip."],"tags":["python","validation","audio","duration","ffmpeg","seedance"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}