{"record":{"id":"3455c44ac87c3b50","repo":"SubtitleEdit/subtitleedit","slug":"moss-tts-crispasr-the-crispasr-server-crashed","errorCode":null,"errorMessage":"MOSS-TTS (CrispASR) — the crispasr server crashed during synthesis.","messagePattern":"MOSS-TTS \\(CrispASR\\) — the crispasr server crashed during synthesis\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/ui/Features/Video/TextToSpeech/Engines/MossTtsCrispAsr.cs","lineNumber":476,"sourceCode":"            response = await HttpClient.PostAsync($\"{ServerBaseUrl}/v1/audio/speech\", content, cancellationToken);\n        }\n        catch (HttpRequestException ex)\n        {\n            var serverLog = SnapshotServerLog();\n            var launchCommand = _serverLaunchCommand;\n            var died = _serverProcess?.HasExited == true;\n            if (died)\n            {\n                StopServerInternal();\n            }\n\n            var failMsg = $\"MOSS-TTS (CrispASR) request failed — Voice: {mossVoice}, Text: {text}, \"\n                + $\"RequestJson: {body}, ServerExited: {died}, ServerLog: {serverLog}\"\n                + LaunchCmdSuffix(launchCommand);\n            Se.LogError(ex, failMsg);\n            Se.WriteToolsLog(failMsg);\n\n            throw new InvalidOperationException(\n                (died\n                    ? \"MOSS-TTS (CrispASR) — the crispasr server crashed during synthesis.\"\n                    : \"MOSS-TTS (CrispASR) request failed — the connection to the crispasr server was dropped.\")\n                + (string.IsNullOrEmpty(serverLog) ? string.Empty : $\"{Environment.NewLine}Server log:{Environment.NewLine}{serverLog}\")\n                + LaunchCmdSuffix(launchCommand),\n                ex);\n        }\n\n        using (response)\n        {\n            if (!response.IsSuccessStatusCode)\n            {\n                var errorBody = await SafeReadErrorAsync(response, cancellationToken);\n                var serverLog = SnapshotServerLog();\n                var launchCommand = _serverLaunchCommand;\n                var errMsg = $\"MOSS-TTS (CrispASR) server error {(int)response.StatusCode} {response.StatusCode} — \"\n                    + $\"Voice: {mossVoice}, Text: {text}, RequestJson: {body}, \"\n                    + $\"ResponseBody: {errorBody}, ServerLog: {serverLog}\"","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Features/Video/TextToSpeech/Engines/MossTtsCrispAsr.cs#L458-L494","documentation":"InvalidOperationException from the HttpRequestException catch in MossTtsCrispAsr.Speak when the POST to `/v1/audio/speech` fails AND the server process has exited (`died == true`). The MOSS-TTS crispasr server crashed mid-synthesis; StopServerInternal is called, the inner HttpRequestException is chained, and the server log + launch command are appended so the next call starts a fresh server.","triggerScenarios":"Reference WAV malformed so the moss backend segfaults during cloning; OOM/GPU fault killing the server mid-inference; corrupt model GGUF aborting on first synth; CUDA driver crash during generation.","commonSituations":"Reference WAV wrong sample rate/channel layout; VRAM exhausted by another process mid-render; truncated model download; backend bug on specific input.","solutions":["Inspect the appended `Server log:` tail — the backend crash reason is logged before exit.","Retry once; EnsureServerRunningAsync starts a fresh server. Repeated death on the same input points to the reference WAV or model.","Re-encode the reference WAV to mono PCM at the expected sample rate.","Free VRAM/RAM at failure time; close other GPU workloads.","Chunk very long input text and retry per chunk."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Before batch synth, confirm server alive and reference WAV valid\nif (engine.IsServerDown() || !File.Exists(mossVoice.FilePath)) { WarnUser(...); return; }","typeGuard":null,"tryCatchPattern":"try { await mossEngine.Speak(...); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"server crashed during synthesis\"))\n{\n    // Server auto-stopped; next call starts fresh. Retry once.\n    await mossEngine.Speak(...);\n}","preventionTips":["Pre-validate the reference WAV format (mono PCM) to avoid mid-synth crashes.","Monitor VRAM and skip synth while another GPU job runs.","Serialize Speak calls per server instance.","Log the inner HttpRequestException to correlate with backend traces."],"tags":["moss-tts","crispasr","server-crash","http","tts","synthesis"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}