apache/seatunnel · error · FileConnectorException
DATA_DESERIALIZE_FAILED
DATA_DESERIALIZE_FAILED
Error message
Deserialize this data [%s] failed, please check the origin data
What it means
TextReadStrategy.processLineData deserializes each raw text line per the configured field delimiters/schema; an IOException from the deserializer is wrapped as FileConnectorException(DATA_DESERIALIZE_FAILED) with the offending line. It means one line of the text file did not match the expected row format.
Source
Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/TextReadStrategy.java:266
for (int i = 0; i < indexes.length; i++) {
fields[i] = seaTunnelRow.getField(indexes[i]);
}
seaTunnelRow = new SeaTunnelRow(fields);
}
if (isMergePartition) {
int index = seaTunnelRowType.getTotalFields();
for (String value : partitionsMap.values()) {
seaTunnelRow.setField(index++, value);
}
}
seaTunnelRow.setTableId(tableId);
output.collect(seaTunnelRow);
} catch (IOException e) {
String errorMsg =
String.format(
"Deserialize this data [%s] failed, please check the origin data",
line);
throw new FileConnectorException(
FileConnectorErrorCode.DATA_DESERIALIZE_FAILED, errorMsg, e);
}
}
@Override
public SeaTunnelRowType getSeaTunnelRowTypeInfo(String path) {
this.seaTunnelRowType = CatalogTableUtil.buildSimpleTextSchema();
this.seaTunnelRowTypeWithPartition =
mergePartitionTypes(getPathForPartitionInference(path), seaTunnelRowType);
initFormatter();
if (pluginConfig.hasPath(FileBaseSourceOptions.READ_COLUMNS.key())) {
throw new FileConnectorException(
SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,
"When reading text files, if user has not specified schema information, "
+ "SeaTunnel will not support column projection");
}
ReadonlyConfig readonlyConfig = ReadonlyConfig.fromConfig(pluginConfig);
TextDeserializationSchema.Builder builder =View on GitHub (pinned to cf67b549a7)
Solutions
- Align the delimiter (field_delimiter) and encoding with the actual file content, inspecting a sample line shown in the error
- Fix or skip the malformed line in the source file; check for blank/short lines at file ends
- Verify declared field types match the data (e.g. numbers not containing thousand separators)
- If the file is CSV with quoting, use the csv read strategy instead of text
Example fix
// before field_delimiter = "," // file actually uses tabs // after field_delimiter = "\t" // matches origin data
Defensive patterns
Strategy: try-catch
Validate before calling
// sample first line and compare delimiter counts to declared fields
try (BufferedReader r = Files.newBufferedReader(path, charset)) {
String line = r.readLine();
int cols = line.split(Pattern.quote(delimiter), -1).length;
if (cols != declaredFieldCount)
throw new IllegalStateException("Delimiter/field mismatch: got " + cols + " expected " + declaredFieldCount);
} Try / catch
try {
processLineData(line);
} catch (FileConnectorException e) {
if (FileConnectorErrorCode.DATA_DESERIALIZE_FAILED.equals(e.getErrorCode())) {
LOG.warn("Skipping malformed line: {}", line);
} else throw e;
} Prevention
- Verify field_delimiter and encoding against a file sample before running jobs
- Prefer the csv strategy for quoted CSV data instead of text
- Declare schema field types that match actual data; strip blank trailing lines
When it happens
Trigger: A line whose field count or content cannot be parsed with the configured delimiter/field types (e.g. delimiter='\t' but file uses ','; quoted fields; empty/extra trailing delimiter; encoding mismatch).
Common situations: Files exported with different delimiters than configured; schema/field-type declarations that don't match data; stray blank lines; mixed encodings; CSV-style quoting inside plain-text delimited files.
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
- FileConnectorErrorCode.DATA_DESERIALIZE_FAILED
- Unsupported byte value '${value}' for row kind.
- Json parse object exception!
- Json parse list exception!
- json to map exception!
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/9e49722cae120771.
Report an issue: GitHub.