apache/seatunnel · error · FileConnectorException

FILE_READ_FAILED

FILE_READ_FAILED

Error message

Read data failed, tableId=[${tableId}], file=[${filePath}], splitId=[${splitId}]

What it means

This wraps any exception thrown by readStrategy.read(...) during split consumption in pollNext into a FileConnectorException with code FILE_READ_FAILED, preserving the cause and adding tableId, file path, and splitId context so the failing file is identifiable. It signals a genuine read failure (corrupt file, schema mismatch, IO/permission error) rather than a config error.

Source

Thrown at seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/source/reader/MultipleTableHiveSourceReader.java:89

        synchronized (output.getCheckpointLock()) {
            FileSourceSplit split = sourceSplits.poll();
            if (null != split) {
                ReadStrategy readStrategy = readStrategyMap.get(split.getTableId());
                if (readStrategy == null) {
                    throw new FileConnectorException(
                            FILE_READ_STRATEGY_NOT_SUPPORT,
                            "Cannot found the read strategy for this table: ["
                                    + split.getTableId()
                                    + "]");
                }
                try {
                    readStrategy.read(split.getFilePath(), split.getTableId(), output);
                } catch (Exception e) {
                    String errorMsg =
                            String.format(
                                    "Read data failed, tableId=[%s], file=[%s], splitId=[%s]",
                                    split.getTableId(), split.getFilePath(), split.splitId());
                    throw new FileConnectorException(FILE_READ_FAILED, errorMsg, e);
                }
            } else if (noMoreSplit && sourceSplits.isEmpty()) {
                // signal to the source that we have reached the end of the data.
                log.info(
                        "There is no more element for the bounded MultipleTableLocalFileSourceReader");
                context.signalNoMoreElement();
            }
        }
    }

    @Override
    public List<FileSourceSplit> snapshotState(long checkpointId) {
        return new ArrayList<>(sourceSplits);
    }

    @Override
    public void addSplits(List<FileSourceSplit> splits) {
        sourceSplits.addAll(splits);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect the root cause (cause chain) and the file path in the message; verify the file exists and is readable from the cluster
  2. Re-run the job after the underlying file issue (deletion/compaction/permission) is resolved
  3. Align the configured read schema with the actual file schema; enable schema-evolution-tolerant settings if supported
  4. Check HDFS/storage health and permission for the job's user
Defensive patterns

Strategy: retry

Validate before calling

// Before job: check split files exist and are readable
for (String path : expectedFilePaths) {
    if (!fileSystem.exists(new org.apache.hadoop.fs.Path(path))) {
        throw new IllegalStateException("Missing input file: " + path);
    }
}

Try / catch

try {
    reader.pollNext(output);
} catch (FileConnectorException e) {
    if (e.getSeaTunnelErrorCode() == FileConnectorErrorCode.FILE_READ_FAILED) {
        // log e.getCause(); retry with backoff or fail over after fixing file/schema issue
    }
}

Prevention

When it happens

Trigger: readStrategy.read(split.getFilePath(), split.getTableId(), output) throws any Exception while reading the split's file — IO errors, deserialization/schema evolution errors, HDFS permission or missing-file errors, corrupt parquet/orc footers.

Common situations: Files deleted or compacted in Hive while the job is running (split points to a stale path); permission changes on HDFS; schema mismatch between the file and configured schema; unsupported/corrupt file written by another job.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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