{"record":{"id":"23e31c996afb0523","repo":"opendataloader-project/opendataloader-pdf","slug":"empty-response-body","errorCode":null,"errorMessage":"Empty response body","messagePattern":"Empty response body","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/hybrid/DoclingFastServerClient.java","lineNumber":198,"sourceCode":"            .url(baseUrl + CONVERT_ENDPOINT)\n            .post(bodyBuilder.build())\n            .build();\n    }\n\n    /**\n     * Parses the HTTP response into a HybridResponse.\n     */\n    private HybridResponse parseResponse(Response response) throws IOException {\n        if (!response.isSuccessful()) {\n            ResponseBody body = response.body();\n            String bodyStr = body != null ? body.string() : \"\";\n            throw new IOException(\"Docling Fast Server request failed with status \" + response.code() +\n                \": \" + bodyStr);\n        }\n\n        ResponseBody body = response.body();\n        if (body == null) {\n            throw new IOException(\"Empty response body\");\n        }\n\n        String responseStr = body.string();\n        JsonNode root = objectMapper.readTree(responseStr);\n\n        // Check for API error status\n        JsonNode statusNode = root.get(\"status\");\n        String status = statusNode != null ? statusNode.asText() : \"\";\n        if (\"failure\".equals(status)) {\n            JsonNode errorsNode = root.get(\"errors\");\n            String errorMessage = errorsNode != null ? errorsNode.toString() : \"Unknown error\";\n            throw new IOException(\"Docling Fast Server processing failed: \" + errorMessage);\n        }\n\n        // Log partial_success status\n        if (\"partial_success\".equals(status)) {\n            JsonNode errorsNode = root.get(\"errors\");\n            LOGGER.log(Level.WARNING, \"Backend returned partial_success: {0}\",","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/hybrid/DoclingFastServerClient.java#L180-L216","documentation":"parseResponse received a 2xx response but response.body() is null, leaving nothing to parse into a HybridResponse. OkHttp returns a null body only in unusual cases (no-content responses, premature stream close, or a misbehaving proxy), so this is treated as a protocol/server defect rather than a content error.","triggerScenarios":"The convert endpoint returns 2xx with a null ResponseBody (e.g. HTTP 204, or a proxy/gateway that strips the body).","commonSituations":"A reverse proxy/load balancer between client and server that returns 204 or drops the body on large responses; server returning 204 by mistake; keep-alive connection reused after a body was already consumed.","solutions":["Bypass any reverse proxy and hit the docling-fast-server directly to confirm it returns a body","Check the server returns 200 (not 204) with a JSON body","Retry the request; transient null bodies are often connection-reuse artifacts","Report to the server operator if it reproduces against the bare server"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return client.convert(request);\n} catch (IOException e) {\n    if (\"Empty response body\".equals(e.getMessage())) {\n        // likely a proxy stripping the body — retry once against the direct URL\n        return client.convert(request);\n    }\n    throw e;\n}","preventionTips":["Route the client directly to the server, not through a body-stripping proxy","Verify the server returns 200 with a JSON body, not 204","Treat a recurring 'Empty response body' as a server/proxy defect to escalate"],"tags":["hybrid","docling-fast","response-parsing","proxy"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}