{"record":{"id":"74993fc1be0b6636","repo":"gravitational/teleport","slug":"sse-event-exceeded-max-size","errorCode":null,"errorMessage":"sse event exceeded max size","messagePattern":"sse event exceeded max size","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/httplib/sse/sse.go","lineNumber":35,"sourceCode":"package sse\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"iter\"\n\t\"strings\"\n\n\t\"github.com/gravitational/trace\"\n\n\t\"github.com/gravitational/teleport\"\n)\n\nvar (\n\t// ErrEventTooLarge is the error returned when SSE event is larger than\n\t// [MaxReadEventSize].\n\tErrEventTooLarge = errors.New(\"sse event exceeded max size\")\n)\n\n// MaxReadEventSize defines the max size that can be read from an [io.Reader]\n// to complete the event.\nconst MaxReadEventSize = teleport.MaxHTTPResponseSize\n\n// Event is a server-sent event.\ntype Event struct {\n\tEvent string\n\tID    string\n\tData  []byte\n\tRetry string\n}\n\n// Empty reports whether the event is empty.\nfunc (e Event) Empty() bool {\n\treturn e.len() == 0\n}","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/gravitational/teleport/blob/1283425b60ec5f60d509ba4c791183d452923ff7/lib/httplib/sse/sse.go#L17-L53","documentation":"Exported sentinel ErrEventTooLarge returned by the SSE reader iterator: an incoming server-sent event (event name, ID, or data line) would cause the accumulated event to exceed MaxReadEventSize (teleport.MaxHTTPResponseSize), which guards against unbounded memory consumption from a malicious or misbehaving server.","triggerScenarios":"Thrown at lib/httplib/sse/sse.go:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check whether the server legitimately sends events larger than MaxReadEventSize and reduce event payload size","Verify the stream is not corrupted or malicious (e.g. a server sending an endless data line)","If a larger limit is genuinely required, adjust the response size limit configuration and restart"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1283425b60ec5f60d509ba4c791183d452923ff7","analyzedAt":"2026-09-02T04:06:41.601Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}