{"record":{"id":"eaf11013997006f9","repo":"apache/seatunnel","slug":"create-index-failed-eaf110","errorCode":"CREATE_INDEX_FAILED","errorMessage":"PUT {endpoint} response null","messagePattern":"PUT (.+?) response null","errorType":"error_code","errorClass":"ElasticsearchConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/EsRestClient.java","lineNumber":620,"sourceCode":"            throw new ElasticsearchConnectorException(\n                    ElasticsearchConnectorErrorCode.LIST_INDEX_FAILED, ex);\n        }\n    }\n\n    public void createIndex(String indexName) {\n        createIndex(indexName, null);\n    }\n\n    public void createIndex(String indexName, String mapping) {\n        String endpoint = String.format(\"/%s\", indexName.toLowerCase());\n        Request request = new Request(\"PUT\", endpoint);\n        if (StringUtils.isNotEmpty(mapping)) {\n            request.setJsonEntity(mapping);\n        }\n        try {\n            Response response = restClient.performRequest(request);\n            if (response == null) {\n                throw new ElasticsearchConnectorException(\n                        ElasticsearchConnectorErrorCode.CREATE_INDEX_FAILED,\n                        \"PUT \" + endpoint + \" response null\");\n            }\n            String entity = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);\n            if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {\n                throw new ElasticsearchConnectorException(\n                        ElasticsearchConnectorErrorCode.CREATE_INDEX_FAILED,\n                        String.format(\n                                \"PUT %s response status code=%d, body=%s\",\n                                endpoint, response.getStatusLine().getStatusCode(), entity));\n            }\n        } catch (IOException ex) {\n            throw new ElasticsearchConnectorException(\n                    ElasticsearchConnectorErrorCode.CREATE_INDEX_FAILED, ex);\n        }\n    }\n\n    public void dropIndex(String tableName) {","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/EsRestClient.java#L602-L638","documentation":"Thrown when a PUT /{index} request to create an index (optionally with a mapping body) returns a null Response. The library raises CREATE_INDEX_FAILED since it cannot confirm the index creation outcome.","triggerScenarios":"createIndex call where restClient.performRequest returns null for the PUT index request.","commonSituations":"Wrapped/custom RestClient implementations; proxy or load-balancer anomalies silently dropping responses.","solutions":["Confirm the standard ES Low Level REST Client is used and correctly configured (hosts, auth, scheme)","Check intermediary proxies/LBs for dropped or intercepted PUT requests","Trace the REST client at wire level to see whether Elasticsearch actually answered","Verify the cluster is reachable and the response path is not mangled by security plugins"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"boolean hasResponse(Response r) { return r != null; }","tryCatchPattern":"try {\n    client.createIndex(indexName, mapping);\n} catch (ElasticsearchConnectorException e) {\n    if (e.getMessage().contains(\"response null\")) {\n        // verify creation with GET /{index} before proceeding\n        if (client.indexExists(indexName)) return; // created despite null response\n    }\n    throw e;\n}","preventionTips":["Do not wrap the RestClient in interceptors that can suppress responses","Confirm index creation with a follow-up existence check when responses look unreliable","Keep proxy/LB settings permissive for PUT requests to ES"],"tags":["elasticsearch","http","null-response","index-creation"],"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"}