{"record":{"id":"563517d976d03d9b","repo":"apache/seatunnel","slug":"common-error-code-1-563517","errorCode":"COMMON_ERROR_CODE-1","errorMessage":"Schema information is undefined or misconfigured, please check your configuration file.","messagePattern":"Schema information is undefined or misconfigured, please check your configuration file\\.","errorType":"validation","errorClass":"FileConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/XmlReadStrategy.java","lineNumber":231,"sourceCode":"                    \"Failed to initialize secure XML parser while reading file [\" + filePath + \"]\",\n                    e);\n        }\n        return saxReader;\n    }\n\n    @Override\n    public SeaTunnelRowType getSeaTunnelRowTypeInfo(String path) throws FileConnectorException {\n        throw new FileConnectorException(\n                CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION,\n                \"User must defined schema for xml file type\");\n    }\n\n    @Override\n    public void setCatalogTable(CatalogTable catalogTable) {\n        SeaTunnelRowType rowType = catalogTable.getSeaTunnelRowType();\n        if (ArrayUtils.isEmpty(rowType.getFieldNames())\n                || ArrayUtils.isEmpty(rowType.getFieldTypes())) {\n            throw new FileConnectorException(\n                    CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                    \"Schema information is undefined or misconfigured, please check your configuration file.\");\n        }\n\n        String partitionPath = getPathForPartitionInference(null);\n        if (readColumns.isEmpty()) {\n            this.seaTunnelRowType = rowType;\n            this.seaTunnelRowTypeWithPartition = mergePartitionTypes(partitionPath, rowType);\n        } else {\n            if (readColumns.retainAll(Arrays.asList(rowType.getFieldNames()))) {\n                log.warn(\n                        \"The read columns configuration will be filtered by the schema configuration, this may cause the actual results to be inconsistent with expectations. This is due to read columns not being a subset of the schema, \"\n                                + \"maybe you should check the schema and read_columns!\");\n            }\n            int[] indexes = new int[readColumns.size()];\n            String[] fields = new String[readColumns.size()];\n            SeaTunnelDataType<?>[] types = new SeaTunnelDataType[readColumns.size()];\n            for (int i = 0; i < readColumns.size(); i++) {","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/XmlReadStrategy.java#L213-L249","documentation":"setCatalogTable validates that the CatalogTable provided to XmlReadStrategy has non-empty field names and field types. If the schema declared in the configuration is empty or malformed, ILLEGAL_ARGUMENT is thrown.","triggerScenarios":"Called by createXmlReadStrategy/testXmlRead when catalogTable.getSeaTunnelRowType() has empty getFieldNames() or getFieldTypes().","commonSituations":"The schema block exists but contains no fields, fields are declared with invalid types so they parse to empty, or the schema option is nested at the wrong level of the HOCON config.","solutions":["Add at least one field under schema.fields in the source configuration.","Verify field type names are valid SeaTunnel types (string, int, boolean, etc.).","Check the schema is declared inside the correct source plugin block, not at job root level."],"exampleFix":"// before\nschema = {\n  fields {\n  }\n}\n// after\nschema = {\n  fields {\n    id = int\n    name = string\n  }\n}","handlingStrategy":"validation","validationCode":"List<String> names = schema.getFieldNames();\nif (names == null || names.isEmpty()) throw new IllegalArgumentException(\"schema.fields must declare at least one field\");","typeGuard":null,"tryCatchPattern":"try {\n  strategy.setCatalogTable(catalogTable);\n} catch (FileConnectorException e) {\n  if (e.getMessage().contains(\"Schema information is undefined\")) {\n    throw new ConfigException(\"Fix schema.fields in source config\", e);\n  }\n  throw e;\n}","preventionTips":["Check the rendered config after template substitution — empty fields blocks silently become this error.","Validate schema field type names against SeaTunnel supported types.","Keep schema at the correct nesting level in the plugin block."],"tags":["file-connector","xml","schema","config"],"backgroundTag":"schema-validation-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}