{"record":{"id":"4960ec3795d928d9","repo":"sgl-project/sglang","slug":"multimodal-data-is-corrupted-or-cannot-be-decoded-4960ec","errorCode":null,"errorMessage":"Multimodal data is corrupted or cannot be decoded: {e}","messagePattern":"Multimodal data is corrupted or cannot be decoded: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/multimodal/processors/mimo_v2_asr.py","lineNumber":261,"sourceCode":"                            type=\"audio\",\n                            content=AudioInput(audio=audio_source),\n                        )\n                    )\n            else:\n                if text_part:\n                    contents.append(_Content(type=\"text\", content=text_part))\n\n        loop = asyncio.get_running_loop()\n        try:\n            input_ids, audio_inputs, position_ids, rope_deltas = (\n                await loop.run_in_executor(\n                    self.io_executor,\n                    lambda: self._process_contents(contents),\n                )\n            )\n        except RuntimeError as e:\n            logger.error(f\"MiMo ASR processor failed in process_mm_data_async: {e}\")\n            raise ValueError(f\"Multimodal data is corrupted or cannot be decoded: {e}\")\n\n        input_ids_flat = input_ids.flatten()\n        if audio_inputs:\n            mm_items = [\n                MultimodalDataItem(\n                    modality=Modality.AUDIO,\n                    feature=audio_inputs,\n                    offsets=self.get_mm_items_offset(\n                        input_ids=input_ids_flat,\n                        mm_token_id=self.audio_token_id,\n                    ),\n                )\n            ]\n        else:\n            mm_items = []\n\n        return MultimodalProcessorOutput(\n            mm_items=mm_items,","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/multimodal/processors/mimo_v2_asr.py#L243-L279","documentation":"MiMo-v2 ASR processor wraps a RuntimeError from its offline audio decoding (_process_contents run on the io_executor) as 'Multimodal data is corrupted or cannot be decoded'. The underlying exception text is appended, so the real cause (bad file, unsupported codec, truncated download) is in the message tail.","triggerScenarios":"process_mm_data_async submits decoding to the io_executor and the decode raises RuntimeError — corrupt audio bytes, unsupported container/codec, unreadable URL content, or a truncated file.","commonSituations":"Downloading audio over flaky networks producing truncated files, feeding unusual codecs (e.g. odd sample rates or containers) the decoder build does not support, or corrupted base64 payloads from client-side encoding bugs.","solutions":["Inspect the appended {e} text to identify the true decode failure","Re-encode the audio to a standard format (16 kHz mono WAV/FLAC via ffmpeg) and retry","Verify the file is complete and not truncated (compare sizes / re-download)","If the codec is genuinely unsupported by the installed decoder, install/enable the matching backend or transcode server-side"],"exampleFix":"# before\n{\"audio\": \"https://cdn.example.com/clip.bin\"}\n# after\nffmpeg -i clip.bin -ar 16000 -ac 1 clip.wav\n{\"audio\": \"https://cdn.example.com/clip.wav\"}","handlingStrategy":"fallback","validationCode":"import wave\nwave.open(local_path)  # quick sanity decode before upload; or:\nimport subprocess; assert subprocess.run([\"ffprobe\", path]).returncode == 0","typeGuard":null,"tryCatchPattern":"try:\n    resp = client.transcribe(audio)\nexcept ValueError as e:\n    if \"corrupted or cannot be decoded\" in str(e):\n        audio = reencode_wav16k(audio)  # fallback transcode then retry once\n        resp = client.transcribe(audio)\n    else:\n        raise","preventionTips":["Transcode uploads to 16kHz mono WAV/FLAC up front","Verify file integrity (size, ffprobe) before sending","Keep original files so a failed decode can be re-encoded and retried"],"tags":["multimodal","audio","decode","asr","corrupt-file"],"backgroundTag":"media-decode-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}