{"record":{"id":"7dc191daa81143d5","repo":"apache/seatunnel","slug":"request-failed-with-empty-response","errorCode":null,"errorMessage":"Request failed with empty response.","messagePattern":"Request failed with empty response\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/HttpHelper.java","lineNumber":67,"sourceCode":"    private static final int DEFAULT_CONNECT_TIMEOUT = 1000000;\n\n    private SinkConfig sinkConfig;\n\n    public HttpHelper() {}\n\n    public HttpHelper(SinkConfig sinkConfig) {\n        this.sinkConfig = sinkConfig;\n    }\n\n    public HttpEntity getHttpEntity(CloseableHttpResponse resp) {\n        int code = resp.getStatusLine().getStatusCode();\n        if (HttpStatus.SC_OK != code) {\n            log.warn(\"Request failed with code:{}\", code);\n            return null;\n        }\n        HttpEntity respEntity = resp.getEntity();\n        if (null == respEntity) {\n            log.warn(\"Request failed with empty response.\");\n            return null;\n        }\n        return respEntity;\n    }\n\n    public String doHttpPost(String postUrl, Map<String, String> header, String postBody)\n            throws IOException {\n        log.info(\"Executing POST from {}.\", postUrl);\n        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {\n            HttpPost httpPost = new HttpPost(postUrl);\n            if (null != header) {\n                for (Map.Entry<String, String> entry : header.entrySet()) {\n                    httpPost.setHeader(entry.getKey(), String.valueOf(entry.getValue()));\n                }\n            }\n            httpPost.setEntity(new ByteArrayEntity(postBody.getBytes()));\n            try (CloseableHttpResponse resp = httpClient.execute(httpPost)) {\n                HttpEntity respEntity = getHttpEntity(resp);","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/HttpHelper.java#L49-L85","documentation":"In HttpHelper.getHttpEntity, after a 200 status, if the response has no entity body the helper logs this warning and returns null. It signals a success-status response with an empty body, which callers treat as a failed/invalid response.","triggerScenarios":"HTTP 200 response from StarRocks whose CloseableHttpResponse.getEntity() is null — typically server responses with no body (e.g. some 204-like behavior, proxies stripping the body, or aborted connections).","commonSituations":"Intermediary proxy/load balancer swallowing the body; connection closed early; StarRocks endpoint returning a bodyless success response.","solutions":["Inspect which endpoint returned the bodyless response and test it with curl","Check proxy/load balancer configuration for body stripping or connection resets","Retry the request; if persistent, verify StarRocks FE/BE versions compatibility"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// Probe endpoint with curl to confirm it returns a body:\n// curl -i http://fe-host:8030/api/{db}/{table}/_stream_load","typeGuard":"HttpEntity entity = resp.getEntity();\nif (entity == null) {\n    throw new IOException(\"Empty response body from StarRocks\");\n}","tryCatchPattern":null,"preventionTips":["Check proxy/LB configs for body stripping or aggressive timeouts","Test endpoints with curl before integration","Retry bodyless 200 responses with backoff","Keep HttpClient and HttpCore versions consistent"],"tags":["http","starrocks","empty-response"],"backgroundTag":"empty-response-body","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}