{"record":{"id":"4610f4b0df1cc802","repo":"apache/seatunnel","slug":"delete-response-null-when-clearing-scrollid","errorCode":null,"errorMessage":"DELETE {} response null when clearing scrollId {}","messagePattern":"DELETE (.+?) response null when clearing scrollId (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/client/EasysearchClient.java","lineNumber":310,"sourceCode":"            log.warn(\"close easysearch connection error\", e);\n        }\n    }\n\n    public boolean clearScroll(String scrollId) {\n        if (scrollId == null || scrollId.isEmpty()) {\n            return false;\n        }\n\n        String endpoint = \"/_search/scroll\";\n        Request request = new Request(\"DELETE\", endpoint);\n        Map<String, String> param = new HashMap<>();\n        param.put(\"scroll_id\", scrollId);\n        request.setJsonEntity(JsonUtils.toJsonString(param));\n\n        try {\n            Response response = restClient.performRequest(request);\n            if (response == null) {\n                log.warn(\"DELETE {} response null when clearing scrollId {}\", endpoint, scrollId);\n                return false;\n            }\n            int statusCode = response.getStatusLine().getStatusCode();\n            if (statusCode == HttpStatus.SC_OK) {\n                return true;\n            } else {\n                log.warn(\"Failed to clear scrollId {}, status code={}\", scrollId, statusCode);\n                return false;\n            }\n        } catch (IOException e) {\n            log.warn(\"Error clearing scrollId \" + scrollId, e);\n            return false;\n        }\n    }\n\n    /**\n     * first time to request search documents by scroll call /${index}/_search?scroll=${scroll}\n     *","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/client/EasysearchClient.java#L292-L328","documentation":"A WARN logged by EasysearchClient.clearScroll when the REST client's performRequest for the scroll-clear DELETE returns null. The method returns false, meaning the server-side scroll context was not confirmed cleared and may linger until it times out.","triggerScenarios":"Calling clearScroll (invoked after finishing scroll pagination) when the low-level RestClient yields a null Response for the `/_search/scroll` DELETE request carrying the scroll_id.","commonSituations":"Rare RestClient/proxy edge cases; scroll already expired server-side and the endpoint responding abnormally; misconfigured custom endpoint/proxy that drops the DELETE body.","solutions":["Verify the Easysearch endpoint supports the scroll-clear DELETE with a JSON body; check for intermediaries (proxies/LBs) that strip the body.","Treat false as non-fatal — scroll contexts expire via the scroll TTL; rely on `keep-alive` settings instead.","Retry clearScroll once on failure; check client/server logs for the underlying request issue.","Upgrade the Easysearch/RestClient client if null responses are reproducible (client bug)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"boolean cleared = client.clearScroll(scrollId);\nif (!cleared) {\n    log.info(\"scroll {} not cleared, will expire via TTL\", scrollId); // non-fatal\n}","preventionTips":["Keep reasonable scroll TTLs as a cleanup fallback","Avoid proxies that strip DELETE request bodies","Keep the low-level RestClient version aligned with the server"],"tags":["easysearch","scroll","rest-client","cleanup"],"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"}