apache/seatunnel · error · SeaTunnelException

Failed to read schema for table

Error message

Failed to read schema for table %s 

What it means

Thrown by OracleSchema.readTableSchema when Debezium's schema reading for an Oracle table fails with a SQLException. The connector queries Oracle's metadata (via Debezium's OracleDatabaseSchema) to build the TableChanges.TableChange for a tableId; any JDBC failure during that read is wrapped in this SeaTunnelException with the table identifier attached.

Solutions

  1. Verify the table still exists and the configured database.schema.table name matches Oracle exactly (respecting case/quoting).
  2. Grant the user SELECT on the table plus CDC-related privileges (LOGMINING, SELECT ANY TRANSACTION or equivalent for your Debezium version).
  3. Re-run the job; if transient network/ORA errors caused it, check Oracle alert logs and connectivity.
  4. Enable JDBC/Debezium debug logging to see the underlying SQLException cause chain for the exact ORA error.
  5. If a datatype is unsupported, add/adjust column converters or exclude the offending column from tableList where feasible.

Example fix

// before
tableList = ["ORCL.SCOTT.ORDERS"] // table was renamed to ORDERS_ARCHIVE
// after
tableList = ["ORCL.SCOTT.ORDERS_ARCHIVE"] // match the real schema.table name
Defensive patterns

Strategy: validation

Validate before calling

-- run before the job
SELECT owner, table_name FROM all_tables WHERE owner='SCOTT' AND table_name='ORDERS';
-- and check privileges
SELECT privilege FROM all_tab_privs WHERE table_schema='SCOTT' AND table_name='ORDERS' AND grantee='CONNECTOR_USER';

Try / catch

try {
    TableChange change = oracleSchema.getTableSchema(tableId);
} catch (SeaTunnelException e) {
    LOG.error("schema read failed for {} cause={}", tableId, e.getCause(), e);
    throw e;
}

Prevention

When it happens

Trigger: JDBC error while reading table schema for the given TableId, e.g. table dropped or renamed between config parsing and snapshot start, invalid credentials, network/ORA-* errors from Oracle, or unsupported data types causing the underlying schema query to fail.

Common situations: Table dropped after job start; missing SELECT privileges on the table or its metadata (ALL_TAB_COLUMNS etc.); Oracle listener/connection issues mid-snapshot; log mining privileges missing; case-sensitivity mistakes in 'database.schema.table' identifiers.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/oracle/utils/OracleSchema.java:89

                    tableId.catalog(),
                    tableId.schema(),
                    connectorConfig.getTableFilters().dataCollectionFilter(),
                    null,
                    false);
            for (TableId id : tables.tableIds()) {
                TableId tableMapId = resolveTableId(id, tableId, tableMap);
                if (tableMap.containsKey(tableMapId)) {
                    Table table =
                            CatalogTableUtils.mergeCatalogTableConfig(
                                    tables.forTable(id), tableMap.get(tableMapId));
                    TableChanges.TableChange tableChange =
                            new TableChanges.TableChange(
                                    TableChanges.TableChangeType.CREATE, table);
                    schemasByTableId.put(tableMapId, tableChange);
                }
            }
        } catch (SQLException e) {
            throw new SeaTunnelException(
                    String.format("Failed to read schema for table %s ", tableId), e);
        }

        if (!schemasByTableId.containsKey(tableId)) {
            throw new SeaTunnelException(
                    String.format("Can't obtain schema for table %s ", tableId));
        }

        return schemasByTableId.get(tableId);
    }

    static TableId resolveTableId(
            TableId readTableId, TableId requestedTableId, Map<TableId, ?> tableMap) {
        if (tableMap.containsKey(readTableId)) {
            return readTableId;
        }

        TableId readTableIdWithRequestedCatalog =

View on GitHub (pinned to cf67b549a7)