Unverified Commit 909a88c5 authored by Daniel Hiltgen's avatar Daniel Hiltgen Committed by GitHub
Browse files

Improve crash reporting (#7728)

Many model crashes are masked behind "An existing connection was forcibly closed by the remote host"
This captures that common error message and wires in any detected errors from the log.

This also adds the deepseek context shift error to the known errors we capture.
parent f602ab4d
...@@ -838,13 +838,15 @@ func (s *llmServer) Completion(ctx context.Context, req CompletionRequest, fn fu ...@@ -838,13 +838,15 @@ func (s *llmServer) Completion(ctx context.Context, req CompletionRequest, fn fu
} }
if err := scanner.Err(); err != nil { if err := scanner.Err(); err != nil {
if strings.Contains(err.Error(), "unexpected EOF") { if strings.Contains(err.Error(), "unexpected EOF") || strings.Contains(err.Error(), "forcibly closed") {
s.Close() s.Close()
msg := "" var msg string
if s.status != nil && s.status.LastErrMsg != "" { if s.status != nil && s.status.LastErrMsg != "" {
msg = s.status.LastErrMsg msg = s.status.LastErrMsg
} else {
msg = err.Error()
} }
return fmt.Errorf("an unknown error was encountered while running the model %s", msg) return fmt.Errorf("an error was encountered while running the model: %s", msg)
} }
return fmt.Errorf("error reading llm response: %v", err) return fmt.Errorf("error reading llm response: %v", err)
......
...@@ -27,6 +27,7 @@ var errorPrefixes = []string{ ...@@ -27,6 +27,7 @@ var errorPrefixes = []string{
"\"ERR\"", "\"ERR\"",
"error loading model", "error loading model",
"GGML_ASSERT", "GGML_ASSERT",
"Deepseek2 does not support K-shift",
} }
func (w *StatusWriter) Write(b []byte) (int, error) { func (w *StatusWriter) Write(b []byte) (int, error) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment