{"record":{"id":"34de720294e5dadb","repo":"apache/seatunnel","slug":"schema-config-can-not-be-empty-34de72","errorCode":null,"errorMessage":"Schema config can not be empty","messagePattern":"Schema config can not be empty","errorType":"validation","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/MongodbIncrementalSourceFactory.java","lineNumber":143,"sourceCode":"        }\n        return catalogTables;\n    }\n\n    private void validateCatalogTablesAndCollections(\n            List<CatalogTable> catalogTables, List<String> collections) {\n        if (catalogTables.size() != collections.size()) {\n            throw new MongodbConnectorException(\n                    ILLEGAL_ARGUMENT,\n                    \"The number of collections must be equal to the number of schema tables\");\n        }\n    }\n\n    private List<CatalogTable> buildWithConfig(ReadonlyConfig config) {\n        String factoryId = config.get(ConnectorCommonOptions.PLUGIN_NAME).replace(\"-CDC\", \"\");\n        Map<String, Object> schemaMap = config.get(ConnectorCommonOptions.SCHEMA);\n        if (schemaMap != null) {\n            if (schemaMap.isEmpty()) {\n                throw new SeaTunnelException(\"Schema config can not be empty\");\n            }\n            CatalogTable catalogTable = CatalogTableUtil.buildWithConfig(factoryId, config);\n            return Collections.singletonList(catalogTable);\n        }\n        List<Map<String, Object>> schemaMaps = config.get(ConnectorCommonOptions.TABLE_CONFIGS);\n        if (schemaMaps != null) {\n            if (schemaMaps.isEmpty()) {\n                throw new SeaTunnelException(\"tables_configs can not be empty\");\n            }\n            return schemaMaps.stream()\n                    .map(\n                            map ->\n                                    CatalogTableUtil.buildWithConfig(\n                                            factoryId, ReadonlyConfig.fromMap(map)))\n                    .collect(Collectors.toList());\n        }\n        return Collections.emptyList();\n    }","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/MongodbIncrementalSourceFactory.java#L125-L161","documentation":"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.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty schema block with column definitions for each table","Remove the schema option entirely to rely on schema sampling/inference instead","Check for typos or empty nested objects in the schema configuration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}