{"record":{"id":"0e4257646113acdc","repo":"apache/seatunnel","slug":"list-index-failed","errorCode":"LIST_INDEX_FAILED","errorMessage":"GET ${endpoint} response null","messagePattern":"GET (.+?) response null","errorType":"error_code","errorClass":"EasysearchConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/client/EasysearchClient.java","lineNumber":494,"sourceCode":"     */\n    public boolean checkIndexExist(String index) {\n        Request request = new Request(\"HEAD\", \"/\" + index.toLowerCase());\n        try {\n            Response response = restClient.performRequest(request);\n            int statusCode = response.getStatusLine().getStatusCode();\n            return statusCode == 200;\n        } catch (Exception ex) {\n            return false;\n        }\n    }\n\n    public List<String> listIndex() {\n        String endpoint = \"/_cat/indices?format=json\";\n        Request request = new Request(\"GET\", endpoint);\n        try {\n            Response response = restClient.performRequest(request);\n            if (response == null) {\n                throw new EasysearchConnectorException(\n                        EasysearchConnectorErrorCode.LIST_INDEX_FAILED,\n                        \"GET \" + endpoint + \" response null\");\n            }\n            if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {\n                String entity = EntityUtils.toString(response.getEntity());\n                return JsonUtils.toList(entity, Map.class).stream()\n                        .map(map -> map.get(\"index\").toString())\n                        .collect(Collectors.toList());\n            } else {\n                throw new EasysearchConnectorException(\n                        EasysearchConnectorErrorCode.LIST_INDEX_FAILED,\n                        String.format(\n                                \"GET %s response status code=%d\",\n                                endpoint, response.getStatusLine().getStatusCode()));\n            }\n        } catch (IOException ex) {\n            throw new EasysearchConnectorException(\n                    EasysearchConnectorErrorCode.LIST_INDEX_FAILED, ex);","sourceCodeStart":476,"sourceCodeEnd":512,"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#L476-L512","documentation":"listIndex issues GET /_cat/indices?format=json and throws LIST_INDEX_FAILED if the REST client returns a null Response. It's a fail-fast guard used when enumerating all indices (e.g. for table listing in auto-catalog flows).","triggerScenarios":"Called to list all indices for table discovery; restClient.performRequest returns null instead of a Response.","commonSituations":"Transport anomalies through proxies, misconfigured client, or a node accepting the connection but returning no response (half-open connection).","solutions":["Check cluster health (curl /_cluster/health) and reachability of configured hosts","Bypass proxies/LBs to isolate which hop returns null","Retry the listing; transient transport issues resolve after reconnection","Update client/server compatibility (RestClient major version vs server version)"],"exampleFix":"// before\nList<String> idx = client.listIndex();\n// after\nList<String> idx;\ntry { idx = client.listIndex(); } catch (EasysearchConnectorException e) { idx = retryOrEmpty(e); }","handlingStrategy":"retry","validationCode":"try (CloseableHttpResponse r = httpClient.execute(new HttpGet(baseUrl + \"/_cat/indices?format=json\"))) {\n  if (r.getStatusLine().getStatusCode() != 200) throw new IllegalStateException(\"cannot list indices, status=\" + r.getStatusLine().getStatusCode());\n}","typeGuard":"boolean valid(Response r) { return r != null && r.getStatusLine() != null; }","tryCatchPattern":"try { indices = client.listIndex(); } catch (EasysearchConnectorException e) { indices = backoffRetry(3, Collections.emptyList()); }","preventionTips":["Health-check the cluster before discovery","Retry listing on transient transport anomalies","Avoid proxies that can return empty responses","Keep RestClient version aligned with server version"],"tags":["http","null-response","index-listing","easysearch"],"backgroundTag":"http-request-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}