{"record":{"id":"a74b0ccb486a3460","repo":"sgl-project/sglang","slug":"path-duration-seconds-must-be-positive","errorCode":null,"errorMessage":"{path}.duration_seconds must be positive","messagePattern":"(.+?)\\.duration_seconds must be positive","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py","lineNumber":126,"sourceCode":"            f\"{path}.aspect_ratio for task {profile.task!r} must be 'auto' or \"\n            f\"one of {list(MINIMAX_H3_FINITE_ASPECT_RATIOS)!r}, got \"\n            f\"{aspect_ratio!r}\"\n        )\n    if not has_duration:\n        if not profile.duration_from_audio_reference:\n            raise ValueError(f\"{path}.duration_seconds is required\")\n        # ref2va: duration may derive from a reference audio; the\n        # audio-condition presence is enforced after conditions validate.\n    out: dict[str, Any] = {\n        \"short_edge\": short_edge,\n        \"aspect_ratio\": aspect_ratio,\n    }\n    if has_duration:\n        duration = target[\"duration_seconds\"]\n        if isinstance(duration, bool) or not isinstance(duration, (int, float)):\n            raise ValueError(f\"{path}.duration_seconds must be a number\")\n        if duration <= 0:\n            raise ValueError(f\"{path}.duration_seconds must be positive\")\n        if not (\n            MINIMAX_H3_MIN_DURATION_SECONDS\n            <= float(duration)\n            <= MINIMAX_H3_MAX_DURATION_SECONDS\n        ):\n            raise ValueError(\n                f\"{path}.duration_seconds must be in \"\n                f\"[{MINIMAX_H3_MIN_DURATION_SECONDS:g}, \"\n                f\"{MINIMAX_H3_MAX_DURATION_SECONDS:g}], got {duration}\"\n            )\n        out[\"duration_seconds\"] = float(duration)\n    return out\n\n\ndef _validate_conditions(\n    conditions: Any,\n    *,\n    profile: MiniMaxH3TaskProfile,","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py#L108-L144","documentation":"duration_seconds is a number but <= 0. Durations must be positive; 0 or negative values usually indicate a sign error or an unset default like -1.","triggerScenarios":"Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py:126 when the library encounters an invalid state.","commonSituations":"Using -1 or 0 as 'not set' sentinel; computing duration as end-start with reversed timestamps.","solutions":["Use a positive duration within [MIN,MAX] bounds","Replace sentinel values (-1/0) with omission of the key or a real duration"],"exampleFix":"// before\n{\"duration_seconds\": 0}\n// after\n{\"duration_seconds\": 6}","handlingStrategy":"validation","validationCode":"if target.get('duration_seconds', 0) <= 0:\n    raise ValueError('duration_seconds must be > 0')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't use 0/-1 as 'unset' sentinels; omit the key instead"],"tags":["minimax-h3","duration","positive-value"],"backgroundTag":"invalid-value-range","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}