apache/seatunnel · error · CatalogException

Failed to drop table:

Error message

Failed to drop table: 

What it means

LanceCatalog.dropTable calls the Lance namespace service's dropTable; if it throws and the message does not match known 'table does not exist' patterns (or the table does exist but ignoreIfNotExists is false), the error is wrapped in a CatalogException with the table name. It means the drop operation failed for a reason other than a benign not-exists case.

Source

Thrown at seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/catalog/LanceCatalog.java:320

    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)
            throws TableNotExistException, CatalogException {
        DropTableRequest request = new DropTableRequest();
        List<String> ids = Lists.newArrayList(tablePath.getTableName());
        request.setId(ids);
        try {
            namespace.dropTable(request);
        } catch (Exception e) {
            String errorMsg = e.getMessage();
            if (errorMsg != null
                    && (errorMsg.contains("Table does not exist")
                            || errorMsg.contains("TABLE_NOT_FOUND")
                            || errorMsg.contains("404")
                            || errorMsg.contains("Not found"))) {
                if (!ignoreIfNotExists) {
                    throw new TableNotExistException(catalogName, tablePath, e);
                }
            } else {
                throw new CatalogException("Failed to drop table: " + tablePath.getTableName(), e);
            }
        }
    }

    @Override
    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)
            throws DatabaseAlreadyExistException, CatalogException {}

    @Override
    public void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists)
            throws DatabaseNotExistException, CatalogException {}

    private CatalogTable convertTableSchema(
            JsonArrowSchema arrowSchema, TablePath tablePath, Schema arrowSchemaFromDataset) {
        if (Objects.isNull(arrowSchema)) {
            return null;
        }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect the cause (e) for the real backend error — check namespace service connectivity and endpoint config first.
  2. Verify the table identifier is correct and matches how the namespace registers tables (get the exact id via listTables).
  3. Check credentials/permissions of the configured namespace client allow drop operations.
  4. If the table may legitimately be absent and your backend phrases not-found differently, call with ignoreIfNotExists=true and/or pre-check tableExists(tablePath) before dropping.

Example fix

// before
catalog.dropTable(tablePath, false);
// after
if (catalog.tableExists(tablePath)) {
    catalog.dropTable(tablePath, true);
}
Defensive patterns

Strategy: validation

Validate before calling

if (catalog != null && catalog.tableExists(tablePath)) { catalog.dropTable(tablePath, true); }

Try / catch

try { catalog.dropTable(tablePath, ignoreIfNotExists); } catch (CatalogException e) { log.error("drop table {} failed: {}", tablePath, e.getCause(), e); throw e; }

Prevention

When it happens

Trigger: Calling LanceCatalog.dropTable(tablePath, ignoreIfNotExists) when the namespace backend returns an unexpected exception: connection failures to the namespace service, permission errors, malformed table identifiers, or backend errors whose message does not contain 'Table does not exist'/'TABLE_NOT_FOUND'/'404'/'Not found' even though the root cause is a missing table.

Common situations: Namespace service (e.g. Lance REST namespace) is down or unreachable; table path/identifier passed in a format the namespace cannot resolve; IAM/credentials lack delete permission; backend returns a differently-worded not-found error that the string-matching heuristic misses.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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