apache/seatunnel · error · FileConnectorException

COMMON_ERROR_CODE-1

COMMON_ERROR_CODE-1

Error message

Schema information is undefined or misconfigured, please check your configuration file.

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/XmlReadStrategy.java:231

                    "Failed to initialize secure XML parser while reading file [" + filePath + "]",
                    e);
        }
        return saxReader;
    }

    @Override
    public SeaTunnelRowType getSeaTunnelRowTypeInfo(String path) throws FileConnectorException {
        throw new FileConnectorException(
                CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION,
                "User must defined schema for xml file type");
    }

    @Override
    public void setCatalogTable(CatalogTable catalogTable) {
        SeaTunnelRowType rowType = catalogTable.getSeaTunnelRowType();
        if (ArrayUtils.isEmpty(rowType.getFieldNames())
                || ArrayUtils.isEmpty(rowType.getFieldTypes())) {
            throw new FileConnectorException(
                    CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
                    "Schema information is undefined or misconfigured, please check your configuration file.");
        }

        String partitionPath = getPathForPartitionInference(null);
        if (readColumns.isEmpty()) {
            this.seaTunnelRowType = rowType;
            this.seaTunnelRowTypeWithPartition = mergePartitionTypes(partitionPath, rowType);
        } else {
            if (readColumns.retainAll(Arrays.asList(rowType.getFieldNames()))) {
                log.warn(
                        "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, "
                                + "maybe you should check the schema and read_columns!");
            }
            int[] indexes = new int[readColumns.size()];
            String[] fields = new String[readColumns.size()];
            SeaTunnelDataType<?>[] types = new SeaTunnelDataType[readColumns.size()];
            for (int i = 0; i < readColumns.size(); i++) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Add at least one field under schema.fields in the source configuration.
  2. Verify field type names are valid SeaTunnel types (string, int, boolean, etc.).
  3. Check the schema is declared inside the correct source plugin block, not at job root level.

Example fix

// before
schema = {
  fields {
  }
}
// after
schema = {
  fields {
    id = int
    name = string
  }
}
Defensive patterns

Strategy: validation

Validate before calling

List<String> names = schema.getFieldNames();
if (names == null || names.isEmpty()) throw new IllegalArgumentException("schema.fields must declare at least one field");

Try / catch

try {
  strategy.setCatalogTable(catalogTable);
} catch (FileConnectorException e) {
  if (e.getMessage().contains("Schema information is undefined")) {
    throw new ConfigException("Fix schema.fields in source config", e);
  }
  throw e;
}

Prevention

When it happens

Trigger: Called by createXmlReadStrategy/testXmlRead when catalogTable.getSeaTunnelRowType() has empty getFieldNames() or getFieldTypes().

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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