{"record":{"id":"08a92d70714c5762","repo":"apache/seatunnel","slug":"drop-index-failed","errorCode":"DROP_INDEX_FAILED","errorMessage":"DELETE /%s response null","messagePattern":"DELETE /(.+?) 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":546,"sourceCode":"                throw new EasysearchConnectorException(\n                        EasysearchConnectorErrorCode.CREATE_INDEX_FAILED,\n                        String.format(\n                                \"PUT %s response status code=%d\",\n                                endpoint, response.getStatusLine().getStatusCode()));\n            }\n        } catch (IOException ex) {\n            throw new EasysearchConnectorException(\n                    EasysearchConnectorErrorCode.CREATE_INDEX_FAILED, ex);\n        }\n    }\n\n    public void dropIndex(String tableName) {\n        String endpoint = String.format(\"/%s\", tableName);\n        Request request = new Request(\"DELETE\", endpoint);\n        try {\n            Response response = restClient.performRequest(request);\n            if (response == null) {\n                throw new EasysearchConnectorException(\n                        EasysearchConnectorErrorCode.DROP_INDEX_FAILED,\n                        \"DELETE \" + endpoint + \" response null\");\n            }\n            // todo: if the index doesn't exist, the response status code is 200?\n            if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {\n                return;\n            } else {\n                throw new EasysearchConnectorException(\n                        EasysearchConnectorErrorCode.DROP_INDEX_FAILED,\n                        String.format(\n                                \"DELETE %s response status code=%d\",\n                                endpoint, response.getStatusLine().getStatusCode()));\n            }\n        } catch (IOException ex) {\n            throw new EasysearchConnectorException(\n                    EasysearchConnectorErrorCode.DROP_INDEX_FAILED, ex);\n        }\n    }","sourceCodeStart":528,"sourceCodeEnd":564,"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#L528-L564","documentation":"EasysearchClient.dropIndex sends a DELETE /{index} request via the low-level RestClient. If performRequest returns a null Response, the client cannot confirm the index was dropped, so it throws EasysearchConnectorException with DROP_INDEX_FAILED. This guards against silently treating an empty response as success.","triggerScenarios":"Calling dropIndex(tableName) when the Easysearch/Elasticsearch REST client returns null from performRequest (typically a client-side or transport-level anomaly rather than a normal HTTP response).","commonSituations":"Misconfigured or partially-initialized RestClient (wrong addresses scheme), interrupted connections returning an empty response, custom interceptors or proxies swallowing the response body.","solutions":["Verify the cluster URL/hosts configured for the Easysearch catalog are reachable and use the correct http/https scheme.","Check RestClient configuration (connection timeout, request timeout) so transient issues don't yield empty responses.","Upgrade/align the elasticsearch-rest-high-level-client version used by the connector with the cluster version.","Retry the dropIndex call; if the failure persists, inspect proxy/interceptor settings between the job and the cluster."],"exampleFix":"// before\nclient.dropIndex(\"my_index\");\n// after\ntry {\n    client.dropIndex(\"my_index\");\n} catch (EasysearchConnectorException e) {\n    if (e.getErrorCode() == EasysearchConnectorErrorCode.DROP_INDEX_FAILED) {\n        // check cluster connectivity, then retry or log\n    }\n}","handlingStrategy":"try-catch","validationCode":"boolean indexExists = client.performRequest(new Request(\"HEAD\", \"/\" + tableName)).getStatusLine().getStatusCode() == 200;","typeGuard":"null","tryCatchPattern":"try { client.dropIndex(tableName); } catch (EasysearchConnectorException e) { if (e.getErrorCode() == DROP_INDEX_FAILED) { /* check connectivity, retry */ } }","preventionTips":["Verify cluster URL and scheme before running the job","Set sane connection/request timeouts","Make index dropping idempotent"],"tags":["easysearch","rest-client","network","index-management"],"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"}