apache/seatunnel · error · SeaTunnelException

Schema config can not be empty

Error message

Schema config can not be empty

What it means

Validation in MongodbIncrementalSourceFactory.buildWithConfig: an explicitly configured schema block is empty, carrying no column definitions, so no catalog tables can be built for MongoDB CDC and the config is rejected with SeaTunnelException.

Solutions

  1. Provide a non-empty schema block with column definitions for each table
  2. Remove the schema option entirely to rely on schema sampling/inference instead
  3. Check for typos or empty nested objects in the schema configuration
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/MongodbIncrementalSourceFactory.java:143 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/MongodbIncrementalSourceFactory.java:143

        }
        return catalogTables;
    }

    private void validateCatalogTablesAndCollections(
            List<CatalogTable> catalogTables, List<String> collections) {
        if (catalogTables.size() != collections.size()) {
            throw new MongodbConnectorException(
                    ILLEGAL_ARGUMENT,
                    "The number of collections must be equal to the number of schema tables");
        }
    }

    private List<CatalogTable> buildWithConfig(ReadonlyConfig config) {
        String factoryId = config.get(ConnectorCommonOptions.PLUGIN_NAME).replace("-CDC", "");
        Map<String, Object> schemaMap = config.get(ConnectorCommonOptions.SCHEMA);
        if (schemaMap != null) {
            if (schemaMap.isEmpty()) {
                throw new SeaTunnelException("Schema config can not be empty");
            }
            CatalogTable catalogTable = CatalogTableUtil.buildWithConfig(factoryId, config);
            return Collections.singletonList(catalogTable);
        }
        List<Map<String, Object>> schemaMaps = config.get(ConnectorCommonOptions.TABLE_CONFIGS);
        if (schemaMaps != null) {
            if (schemaMaps.isEmpty()) {
                throw new SeaTunnelException("tables_configs can not be empty");
            }
            return schemaMaps.stream()
                    .map(
                            map ->
                                    CatalogTableUtil.buildWithConfig(
                                            factoryId, ReadonlyConfig.fromMap(map)))
                    .collect(Collectors.toList());
        }
        return Collections.emptyList();
    }

View on GitHub (pinned to cf67b549a7)