llm
runtime_error
ai_generated
true
Error: Failed to parse SSE stream: unexpected end of data
ID: llm/streaming-sse-parse
80%Fix Rate
82%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
Server-Sent Events stream from LLM API failed to parse correctly.
genericWorkarounds
-
85% success Handle partial chunks and reconnection in SSE client
Buffer partial data lines; reconnect with Last-Event-ID header
-
90% success Use official SDK streaming helpers
openai.chat.completions.create(stream=True) handles SSE parsing
Dead Ends
Common approaches that don't work:
-
Buffer entire stream before parsing
85% fail
Defeats the purpose of streaming and may OOM on large responses.
-
Use WebSocket instead of SSE
80% fail
Most LLM APIs only support SSE for streaming.