{"record":{"id":"3a9de34bb83b77aa","repo":"conductor-oss/conductor","slug":"no-data-found-in-sse-response-ssebody-3a9de3","errorCode":null,"errorMessage":"No data found in SSE response: {sseBody}","messagePattern":"No data found in SSE response: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/mcp/MCPService.java","lineNumber":365,"sourceCode":"        log.debug(\"Parsing SSE response: {}\", sseBody);\n\n        // Find all \"data:\" lines and concatenate their content\n        StringBuilder jsonData = new StringBuilder();\n        String[] lines = sseBody.split(\"\\n\");\n\n        for (String line : lines) {\n            String trimmed = line.trim();\n            if (trimmed.startsWith(\"data:\")) {\n                String data = trimmed.substring(5).trim();\n                // Skip empty data or \"[DONE]\" markers\n                if (!data.isEmpty() && !data.equals(\"[DONE]\")) {\n                    jsonData.append(data);\n                }\n            }\n        }\n\n        if (jsonData.length() == 0) {\n            throw new RuntimeException(\"No data found in SSE response: \" + sseBody);\n        }\n\n        try {\n            return objectMapper.readTree(jsonData.toString());\n        } catch (Exception e) {\n            throw new RuntimeException(\"Failed to parse SSE data as JSON: \" + jsonData, e);\n        }\n    }\n\n    /** Executes one MCP request and follows redirects while protecting sensitive headers. */\n    private ResponsePayload execute(Request initialRequest) throws Exception {\n        Request request = initialRequest;\n        for (int redirects = 0; redirects <= 5; redirects++) {\n            try (Response response = httpClient.newCall(request).execute()) {\n                if (!response.isRedirect()) {\n                    return new ResponsePayload(\n                            response.code(),\n                            response.header(\"Content-Type\", \"application/json\"),","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/mcp/MCPService.java#L347-L383","documentation":"Thrown by parseSseResponse when an SSE response body contains zero usable `data:` lines. It iterates lines, keeps data: payloads, skips empty and [DONE] markers, and if nothing remained it cannot produce JSON. Means the server sent an SSE stream with only comments, event: lines, ping/keep-alive, or was empty.","triggerScenarios":"Server's content-type was text/event-stream but the body was an empty stream, only `event:` headers, only `: comment` lines, or only `[DONE]` markers; the actual JSON-RPC result event was never delivered (server closed the stream early).","commonSituations":"Long-lived SSE endpoint where the response event hadn't arrived yet but the connection closed; server uses a non-standard field instead of `data:`; interceptor stripped data lines; the response was a heartbeat-only stream.","solutions":["Log the raw SSE body (it is in the exception message) to see what frames were actually sent.","Confirm the server emits `data:` lines for JSON-RPC responses per the MCP SSE transport spec.","If the server uses a different event field, use a compliant server or a custom SSE parser.","Check the connection wasn't closed/truncated before the result event arrived."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    mcpService.listTools(serverUrl, headers);\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"No data found in SSE response\")) {\n        // server sent an SSE stream with no data: lines; check transport compatibility\n    }\n    throw e;\n}","preventionTips":["Confirm the server emits `data:` lines per the MCP SSE transport.","Log the raw SSE body (present in the message) to see what frames were sent.","Prefer the streamable-HTTP JSON endpoint over SSE when available."],"tags":["mcp","sse","malformed-response","event-stream"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}