{"record":{"id":"8bdcecffbd384d59","repo":"apache/seatunnel","slug":"failed-to-drop-table-tablename-in-catalog-cat","errorCode":null,"errorMessage":"Failed to drop table ${tableName} in catalog ${catalogName}","messagePattern":"Failed to drop table (.+?) in catalog (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/catalog/EasysearchCatalog.java","lineNumber":204,"sourceCode":"            return;\n        }\n        ezsClient.createIndex(tablePath.getTableName());\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        checkNotNull(tablePath);\n        if (!tableExists(tablePath)) {\n            if (!ignoreIfNotExists) {\n                throw new TableNotExistException(catalogName, tablePath);\n            }\n            return;\n        }\n        try {\n            ezsClient.dropIndex(tablePath.getTableName());\n        } catch (Exception ex) {\n            throw new CatalogException(\n                    String.format(\n                            \"Failed to drop table %s in catalog %s\",\n                            tablePath.getTableName(), catalogName),\n                    ex);\n        }\n    }\n\n    @Override\n    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)\n            throws DatabaseAlreadyExistException, CatalogException {\n        try {\n            createTable(tablePath, null, ignoreIfExists);\n        } catch (TableAlreadyExistException ex) {\n            throw new DatabaseAlreadyExistException(catalogName, tablePath.getDatabaseName());\n        }\n    }\n\n    @Override","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/catalog/EasysearchCatalog.java#L186-L222","documentation":"EasysearchCatalog.dropTable calls ezsClient.dropIndex to delete the underlying index; any exception from the REST call is wrapped in a CatalogException naming the table and catalog. It means the index deletion request failed at the Easysearch cluster level.","triggerScenarios":"dropTable, or its callers dropDatabase/truncateTable, invoked while the cluster rejects the delete index call: index missing when ignoreIfNotExists=false path passes but cluster errors anyway, security permissions deny delete, or cluster unavailable.","commonSituations":"User lacks delete-index privileges; cluster in read-only mode (disk watermark exceeded); connection reset mid-request; calling truncateTable which delegates to dropTable and surfaces this error.","solutions":["Read the wrapped cause for the real HTTP error (403, 404, cluster blocked).","Check disk watermarks: a full disk makes Easysearch set indices read-only and reject writes/deletes.","Verify the catalog user has delete_index privileges on the target index.","Retry once the cluster is reachable; for truncateTable, ensure both dropTable and createTable can succeed."],"exampleFix":"// before: user without privileges\nString username = \"reader\"; // 403 on delete index\n// after\nString username = \"admin\"; // or grant delete_index to 'reader' role","handlingStrategy":"try-catch","validationCode":"// preflight: index exists and user can delete\nHEAD /<index>\nGET /_security/user/<user> // verify delete_index privilege","typeGuard":null,"tryCatchPattern":"try {\n    catalog.dropTable(tablePath, false);\n} catch (CatalogException e) {\n    Throwable cause = e.getCause();\n    // handle ResponseException with status 403/404/503 accordingly\n    throw e;\n}","preventionTips":["Grant delete_index privilege to the catalog user","Monitor disk watermarks to avoid read_only blocks","Use ignoreIfNotExists=true when the table may not exist"],"tags":["easysearch","catalog","delete-index"],"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"}