{"record":{"id":"5cb89691b4060933","repo":"apache/seatunnel","slug":"config-validation-failed-5cb896","errorCode":"CONFIG_VALIDATION_FAILED","errorMessage":"Mandatory configurations '%s' and '%s' must be specified when reading XML files.","messagePattern":"Mandatory configurations '(.+?)' and '(.+?)' must be specified when reading XML files\\.","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":324,"sourceCode":"                throw new FileConnectorException(\n                        CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,\n                        String.format(\"Unsupported data type: %s\", sqlType));\n        }\n    }\n\n    private String getXPathExpression(String tableRowIdentification) {\n        return String.format(\"//%s\", tableRowIdentification);\n    }\n\n    /** Performs pre-checks and initialization of the configuration for reading XML files. */\n    private void preCheckAndInitializeConfiguration() {\n        ReadonlyConfig readonlyConfig = ReadonlyConfig.fromConfig(pluginConfig);\n        this.tableRowName = readonlyConfig.get(FileBaseSourceOptions.XML_ROW_TAG);\n        this.useAttrFormat = readonlyConfig.get(FileBaseSourceOptions.XML_USE_ATTR_FORMAT);\n\n        // Check mandatory configurations\n        if (StringUtils.isEmpty(tableRowName) || useAttrFormat == null) {\n            throw new FileConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    String.format(\n                            \"Mandatory configurations '%s' and '%s' must be specified when reading XML files.\",\n                            FileBaseSourceOptions.XML_ROW_TAG.key(),\n                            FileBaseSourceOptions.XML_USE_ATTR_FORMAT.key()));\n        }\n\n        this.delimiter = readonlyConfig.get(FileBaseSourceOptions.FIELD_DELIMITER);\n\n        this.dateFormat =\n                getComplexDateConfigValue(\n                        FileBaseSourceOptions.DATE_FORMAT_LEGACY, DateUtils.Formatter::parse);\n        this.timeFormat =\n                getComplexDateConfigValue(\n                        FileBaseSourceOptions.TIME_FORMAT_LEGACY, TimeUtils.Formatter::parse);\n        this.datetimeFormat =\n                getComplexDateConfigValue(\n                        FileBaseSourceOptions.DATETIME_FORMAT_LEGACY,","sourceCodeStart":306,"sourceCodeEnd":342,"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#L306-L342","documentation":"XmlReadStrategy.preCheckAndInitializeConfiguration (called from init) validates that both mandatory XML options — xml_field_row_tag (XML_ROW_TAG) and xml_use_attribute_format (XML_USE_ATTR_FORMAT) — are set. Missing either raises CONFIG_VALIDATION_FAILED.","triggerScenarios":"Source config omits the XML row tag name or the use-attribute-format boolean while file_format_type=xml.","commonSituations":"Copying a JSON/CSV file-source config and switching file_format_type to xml without adding XML-specific keys; typo in the option key.","solutions":["Add xml_field_row_tag = \"<row-tag>\" to the source config.","Add xml_use_attribute_format = true|false to the source config.","Verify option key spelling against FileBaseSourceOptions (xml_field_row_tag, xml_use_attribute_format)."],"exampleFix":"// before\nLocalFile {\n  file_format_type = \"xml\"\n}\n// after\nLocalFile {\n  file_format_type = \"xml\"\n  xml_field_row_tag = \"record\"\n  xml_use_attribute_format = false\n}","handlingStrategy":"validation","validationCode":"if (!config.hasPath(\"xml_field_row_tag\") || !config.hasPath(\"xml_use_attribute_format\")) {\n  throw new IllegalArgumentException(\"xml_field_row_tag and xml_use_attribute_format are required for xml format\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  source.prepare(config);\n} catch (FileConnectorException e) {\n  if (e.getMessage().contains(\"Mandatory configurations\")) {\n    throw new ConfigException(\"Add xml_field_row_tag and xml_use_attribute_format\", e);\n  }\n  throw e;\n}","preventionTips":["Keep an XML-specific config template including both mandatory keys.","Diff config keys against FileBaseSourceOptions when upgrading.","Beware silently dropping keys with empty values in HOCON."],"tags":["file-connector","xml","config-validation","missing-option"],"backgroundTag":"missing-required-config-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}