apache/seatunnel · error · CatalogException

Failed to drop table %s in catalog %s

Error message

Failed to drop table %s in catalog %s

What it means

ElasticSearchCatalog.dropTable wraps any exception raised while deleting an index via esRestClient.dropIndex into a CatalogException with this message. It signals that the catalog could not remove the table (index) named in the message from the Elasticsearch cluster identified by catalogName. The original cause is attached, so the underlying reason ( connectivity, missing index, auth) is in the exception chain.

Source

Thrown at seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/catalog/ElasticSearchCatalog.java:207

            return;
        }
        esRestClient.createIndex(tablePath.getTableName());
    }

    @Override
    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)
            throws TableNotExistException, CatalogException {
        checkNotNull(tablePath);
        if (!tableExists(tablePath)) {
            if (!ignoreIfNotExists) {
                throw new TableNotExistException(catalogName, tablePath);
            }
            return;
        }
        try {
            esRestClient.dropIndex(tablePath.getTableName());
        } catch (Exception ex) {
            throw new CatalogException(
                    String.format(
                            "Failed to drop table %s in catalog %s",
                            tablePath.getTableName(), catalogName),
                    ex);
        }
    }

    @Override
    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)
            throws DatabaseAlreadyExistException, CatalogException {
        try {
            createTable(tablePath, null, ignoreIfExists);
        } catch (TableAlreadyExistException ex) {
            throw new DatabaseAlreadyExistException(catalogName, tablePath.getDatabaseName());
        }
    }

    @Override

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the chained cause (ex) to find the root reason — usually a ResponseException with the ES status code
  2. Verify Elasticsearch connectivity (host, port, credentials) with curl or the catalog testConnection
  3. Confirm the index exists: GET /<index-name>; use ifExists/exists checks before dropping
  4. Ensure the configured user has delete privileges on the index
  5. Retry after the cluster recovers if the cause was a timeout or 5xx

Example fix

// before
catalog.dropTable(tablePath); // throws CatalogException if index missing
// after
if (catalog.tableExists(tablePath)) {
    catalog.dropTable(tablePath);
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (catalog.tableExists(tablePath)) { catalog.dropTable(tablePath); }

Try / catch

try { catalog.dropTable(tablePath); } catch (CatalogException e) { LOG.error("dropTable failed for " + tablePath + ", cause: " + e.getCause(), e); }

Prevention

When it happens

Trigger: Calling ElasticSearchCatalog.dropTable(TablePath) (directly or via dropDatabase/testCatalog) when esRestClient.dropIndex throws: Elasticsearch unreachable, index missing, insufficient permissions, or a non-2xx DELETE response.

Common situations: Elasticsearch node down or wrong host/port in catalog options; table path points to a nonexistent index; user lacks delete-index privileges; network timeout between SeaTunnel and the cluster; cluster in read-only mode.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/a7917578f9d3d212. Report an issue: GitHub.