SubtitleEdit/subtitleedit · critical · TimeoutException
llama-server did not report healthy within 5 minutes. Last o
Error message
llama-server did not report healthy within 5 minutes. Last output: {lastOutput} What it means
TimeoutException thrown when the 5-minute startup deadline elapses without llama-server's /health probe succeeding AND the process never exited. So the server is still running but unresponsive. The message embeds the last captured server output via SnapshotServerLog and the manager then calls StopServerInternal() to clean up.
Source
Thrown at src/libuilogic/LlamaCpp/LlamaCppServerManager.cs:631
_serverProcess = null;
_serverPort = 0;
_serverModelPath = null;
throw new InvalidOperationException(
$"llama-server exited during startup (code {process.ExitCode}). Output: {tail}");
}
if (await ProbeHealthAsync(port, TimeSpan.FromSeconds(2), cancellationToken))
{
Configuration.Settings.Tools.LlamaCppApiUrl = ApiUrl;
return;
}
await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken);
}
var lastOutput = SnapshotServerLog();
StopServerInternal();
throw new TimeoutException(
$"llama-server did not report healthy within 5 minutes. Last output: {lastOutput}");
}
finally
{
ServerLock.Release();
}
}
public static void StopServer()
{
ServerLock.Wait();
try
{
StopServerInternal();
}
finally
{
ServerLock.Release();View on GitHub (pinned to 17a9f07487)
Solutions
- Use a smaller quant or a faster model so load completes well inside 5 minutes on your hardware.
- Keep the .gguf on local SSD so memory-map load is fast; avoid network/USB storage.
- If 5 minutes is genuinely too short for your hardware, raise the deadline constant in StartServer (it is currently hardcoded).
- Reproduce the launch manually and time how long 'model loaded' takes; if it never appears, the model is too large for available RAM and is thrashing.
- Confirm ProbeHealthAsync targets the same loopback port FindFreeLoopbackPort returned — a port mismatch makes the probe miss a healthy server.
Example fix
// before
var deadline = DateTime.UtcNow.AddMinutes(5);
// after — derive from model size so big models get more headroom
var loadMinutes = EstimateLoadMinutes(modelPath) switch { > 0 => Math.Max(5, EstimateLoadMinutes(modelPath)), _ => 5 };
var deadline = DateTime.UtcNow.AddMinutes(loadMinutes); Defensive patterns
Strategy: retry
Validate before calling
var estimatedLoadMinutes = Math.Max(5, new FileInfo(modelPath).Length / (200L * 1024 * 1024)); // ~200MB/min crude floor var deadline = DateTime.UtcNow.AddMinutes(estimatedLoadMinutes);
Type guard
null
Try / catch
try { await StartServerAsync(model, token); }
catch (TimeoutException ex) { SeLogger.Error(ex, "Health probe timed out; consider a smaller model or local SSD."); throw; } Prevention
- Benchmark model load time on your hardware before relying on the 5-minute default.
- Keep .gguf files on local SSD; network/USB storage dominates load time.
- Verify the health-probe port equals the server bind port before treating slow-loads as timeouts.
When it happens
Trigger: Server boots, takes longer than 5 minutes to load the model, and has not answered ProbeHealthAsync on the chosen loopback port. Common on CPU-only hosts loading large models, slow disks, or when the server binds a different port/interface than the probe expects.
Common situations: Large 70B-class model on a slow CPU; cold disk cache; model being memory-mapped off network storage; AV scanning the .gguf during load; server printing 'loading model' for many minutes.
Related errors
- llama-server exited during startup (code {process.ExitCode})
- crispasr (chatterbox) did not report healthy within 15 minut
- crispasr (cosyvoice3-tts) did not report healthy within {(al
- crispasr (moss-tts) did not report healthy within {10|60} mi
- crispasr (omnivoice) did not report healthy within {5|30} mi
AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13).
Data as JSON: /api/errors/1acd8c7c0c3c207e.
Report an issue: GitHub.