apache/seatunnel · error · FileConnectorException

FILE_LIST_GET_FAILED

FILE_LIST_GET_FAILED

Error message

Get file list from this path [%s] failed

What it means

BaseFileSourceConfig.discoverFilePaths wraps any exception raised while listing files under a configured source path into FileConnectorException with code FILE_LIST_GET_FAILED, using the safe discovery root path as context. This non-Markdown branch attaches the original exception as the cause.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseFileSourceConfig.java:150

    private List<String> discoverFilePaths(ReadStrategy discoveryReadStrategy) {
        String rootPath = baseFileSourceConfig.get(FileBaseSourceOptions.FILE_PATH);
        long startTime = System.currentTimeMillis();
        try {
            List<String> discoveredFilePaths = discoveryReadStrategy.getFileNamesByPath(rootPath);
            log.info(
                    "File source discovery finished: plugin={}, path={}, files={}, cost={}ms",
                    getPluginName(),
                    safeDiscoveryRootContext,
                    discoveredFilePaths.size(),
                    System.currentTimeMillis() - startTime);
            return discoveredFilePaths;
        } catch (Exception ex) {
            String errorMsg =
                    String.format(
                            "Get file list from this path [%s] failed", safeDiscoveryRootContext);
            if (isMarkdownKnowledgeSyncMetadataEnabled(baseFileSourceConfig)) {
                throw new FileConnectorException(
                        FileConnectorErrorCode.FILE_LIST_GET_FAILED,
                        errorMsg,
                        MarkdownKnowledgeSyncMetadata.copyStackTraceOnly(ex));
            }
            throw new FileConnectorException(
                    FileConnectorErrorCode.FILE_LIST_GET_FAILED, errorMsg, ex);
        }
    }

    private CatalogTable parseCatalogTable(ReadonlyConfig readonlyConfig) {
        final CatalogTable catalogTable = catalogTableFromConfig;
        boolean configSchema =
                readonlyConfig.getOptional(ConnectorCommonOptions.SCHEMA).isPresent();
        if (CollectionUtils.isEmpty(filePaths)) {
            // When there are no files (including sync_mode=update filtered all files), choose a
            // compatible schema so that downstream can initialize correctly.
            if (fileFormat == FileFormat.BINARY
                    || fileFormat == FileFormat.MARKDOWN

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Verify the configured source path exists and is accessible from the job's execution nodes (test with hadoop fs -ls or the storage CLI).
  2. Fix the path scheme/typos and ensure the filesystem plugin (hdfs-s3/oss, etc.) and credentials (access keys, kerberos, tokens) are correctly configured.
  3. Check filesystem permissions for the SeaTunnel runtime user.
  4. Inspect the caused-by exception in the stack trace for the underlying reason (connection refused, auth error, etc.).

Example fix

// before
path = "/user/seatunnel/data/*.csv"  // path missing on cluster
// after (verified path)
path = "/user/seatunnel/dataset/*.csv"  # exists and readable on all nodes
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight: verify the path is listable before submitting the job
FileSystem fs = FileSystem.get(new Path(sourcePath).toUri(), hadoopConf);
if (!fs.exists(new Path(sourcePath))) {
    throw new IllegalArgumentException("Source path does not exist: " + sourcePath);
}
if (!fs.getFileStatus(new Path(sourcePath)).isDirectory()) {
    throw new IllegalArgumentException("Source path is not a directory: " + sourcePath);
}

Try / catch

try {
    enumerator discovery = sourceConfig.discoverFilePaths(...);
} catch (FileConnectorException e) {
    if (FileConnectorErrorCode.FILE_LIST_GET_FAILED.equals(e.getSeaTunnelErrorCode())) {
        throw new IllegalStateException("Check source path/credentials: " + e.getCause(), e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Any Exception during file discovery (directory does not exist, HDFS/S3/OSS connection failure, permission denied, invalid glob) inside discoverFilePaths, called from getFilePathsForSplitEnumerator or recursively via discoverFilePaths.

Common situations: Typos or wrong scheme in the source 'path' config; Hadoop/S3 credentials missing or expired; path is a file not a directory; network unreachable from the cluster nodes; regex/path patterns matching nothing or failing.

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/9b064b9ff41004f2. Report an issue: GitHub.