{"record":{"id":"3e56b7355364c266","repo":"apache/seatunnel","slug":"failed-to-clear-scrollid-status-code","errorCode":null,"errorMessage":"Failed to clear scrollId {}, status code={}","messagePattern":"Failed to clear scrollId (.+?), status code=(.+?)","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":317,"sourceCode":"        }\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     *\n     * @param index index name\n     * @param source select fields\n     * @param scrollTime such as:1m\n     * @param scrollSize fetch documents count in one request\n     */\n    public ScrollResult searchByScroll(\n            String index,","sourceCodeStart":299,"sourceCodeEnd":335,"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#L299-L335","documentation":"A WARN logged by EasysearchClient.clearScroll when the DELETE scroll-clear request returns a non-200 status code. The scroll context may not have been released; the method returns false so callers can fall back to scroll TTL expiry.","triggerScenarios":"Calling clearScroll and the server responds with a status other than 200 — e.g. 400 for a malformed/already-expired scroll_id, 404 for unknown scroll id, or 5xx for server-side errors.","commonSituations":"Scroll context already expired (TTL elapsed) before cleanup; network path returning error pages; Easysearch cluster under stress returning 5xx.","solutions":["Check the status code and server logs; 404/400 usually means the scroll already expired and is safe to ignore.","Increase the scroll keep-alive (`scroll` timeout in search requests) if scrolls expire before the reader finishes.","Retry clearScroll on transient 5xx responses.","Ensure the cluster is healthy; investigate 5xx causes (disk, queue capacity)."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if (!client.clearScroll(scrollId)) {\n    log.debug(\"clearScroll returned non-200; relying on scroll TTL expiry\");\n}","preventionTips":["Set scroll keep-alive longer than the longest fetch cycle","Monitor cluster health to avoid 5xx during cleanup","Treat cleanup failures as non-fatal"],"tags":["easysearch","scroll","http-status","cleanup"],"backgroundTag":"http-error-response","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"}