{"record":{"id":"d74d0378e48b166a","repo":"SubtitleEdit/subtitleedit","slug":"indextts-crispasr-the-crispasr-server-crashed","errorCode":null,"errorMessage":"IndexTTS (CrispASR) — the crispasr server crashed during synthesis.","messagePattern":"IndexTTS \\(CrispASR\\) — the crispasr server crashed during synthesis\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/ui/Features/Video/TextToSpeech/Engines/IndexTtsCrispAsr.cs","lineNumber":424,"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 = $\"IndexTTS (CrispASR) request failed — Voice: {indexVoice}, 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                    ? \"IndexTTS (CrispASR) — the crispasr server crashed during synthesis.\"\n                    : \"IndexTTS (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 = $\"IndexTTS (CrispASR) server error {(int)response.StatusCode} {response.StatusCode} — \"\n                    + $\"Voice: {indexVoice}, Text: {text}, RequestJson: {body}, \"\n                    + $\"ResponseBody: {errorBody}, ServerLog: {serverLog}\"","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Features/Video/TextToSpeech/Engines/IndexTtsCrispAsr.cs#L406-L442","documentation":"InvalidOperationException from the HttpRequestException catch in IndexTtsCrispAsr.Speak when the POST to `/v1/audio/speech` throws AND the server process has already exited (`died == true`). The server crashed mid-synthesis; StopServerInternal is called, the inner HttpRequestException is chained, and the server log + launch command are appended. This means a fresh server will be started on the next call.","triggerScenarios":"The reference WAV is malformed so the backend segfaults during cloning; an OOM/GPU fault kills the server mid-inference; the model GGUF is corrupt and the server aborts on the first synth; a CUDA driver crash during generation.","commonSituations":"Reference WAV is the wrong sample rate/channel layout; GPU VRAM exhausted by another process mid-render; corrupt or truncated model download; CrispASR backend bug on specific input text (e.g. very long or non-UTF8).","solutions":["Inspect the appended `Server log:` tail — the backend's crash reason is logged right before exit.","Retry once; EnsureServerRunningAsync will start a fresh server. If it dies again on the same input, the reference WAV or model is the cause.","Re-encode the reference WAV to 24 kHz mono PCM.","Check VRAM/free RAM at the moment of failure; close other GPU workloads.","If the crash is input-specific (long text), chunk the text and retry per chunk."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Before batch synth, probe the server is alive and the reference WAV is valid\nif (engine.IsServerDown() || !File.Exists(indexVoice.FilePath)) { WarnUser(...); return; }","typeGuard":null,"tryCatchPattern":"try { await indexEngine.Speak(...); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"server crashed during synthesis\"))\n{\n    // Server is auto-stopped; EnsureServerRunningAsync will start a fresh one. Retry once.\n    await indexEngine.Speak(...);\n}","preventionTips":["Pre-validate the reference WAV format (24 kHz mono) to avoid mid-synth segfaults.","Monitor VRAM and skip synth while another GPU job is running.","Keep batch jobs single-threaded per server to avoid concurrent-clone crashes.","Log the inner HttpRequestException to correlate with backend stack traces."],"tags":["indextts","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"}