apache/seatunnel · error · IMapStorageException
get file names error,path is s%
Error message
get file names error,path is s%
What it means
IMapStorageException thrown by DefaultReader.getFileNames when listing WAL segment files under parentPath throws an IOException. Only files whose name ends with "wal.txt" are collected; any failure during the filesystem listStatus call is wrapped in this error. Note the message has a typo: 's%' instead of '%s', so the path will not be interpolated into the message text.
Source
Thrown at seatunnel-engine/seatunnel-engine-storage/imap-storage-plugins/imap-storage-file/src/main/java/org/apache/seatunnel/engine/imap/storage/file/wal/reader/DefaultReader.java:85
}
private List<String> getFileNames(Path parentPath) {
try {
if (!fs.exists(parentPath)) {
return new ArrayList<>();
}
RemoteIterator<LocatedFileStatus> fileStatusRemoteIterator =
fs.listFiles(parentPath, true);
List<String> fileNames = new ArrayList<>();
while (fileStatusRemoteIterator.hasNext()) {
LocatedFileStatus fileStatus = fileStatusRemoteIterator.next();
if (fileStatus.getPath().getName().endsWith("wal.txt")) {
fileNames.add(fileStatus.getPath().toString());
}
}
return fileNames;
} catch (IOException e) {
throw new IMapStorageException(e, "get file names error,path is s%", parentPath);
}
}
private List<IMapFileData> readData(Path path) throws IOException {
List<IMapFileData> result = new ArrayList<>(DEFAULT_QUERY_LIST_SIZE);
long length = fs.getFileStatus(path).getLen();
try (FSDataInputStream in = fs.open(path)) {
byte[] datas = new byte[(int) length];
in.readFully(datas);
int startIndex = 0;
while (startIndex + WAL_DATA_METADATA_LENGTH < datas.length) {
byte[] metadata = new byte[WAL_DATA_METADATA_LENGTH];
System.arraycopy(datas, startIndex, metadata, 0, WAL_DATA_METADATA_LENGTH);
int dataLength = WALDataUtils.byteArrayToInt(metadata);
startIndex += WAL_DATA_METADATA_LENGTH;
if (startIndex + dataLength > datas.length) {
break;View on GitHub (pinned to cf67b549a7)
Solutions
- Verify parentPath exists and is readable (fs.exists / fs.canRead equivalent)
- Check the storage backend connectivity and permissions
- Correct the path in the storage configuration
- Inspect the wrapped IOException stack trace for the real cause
- Optionally fix the format-string typo 's%' -> '%s' in the source
Example fix
// before throw new IMapStorageException(e, "get file names error,path is s%", parentPath); // after throw new IMapStorageException(e, "get file names error, path is %s", parentPath);
Defensive patterns
Strategy: try-catch
Validate before calling
if (!fs.exists(new Path(parentPath))) throw new IllegalStateException("WAL dir missing: " + parentPath); Try / catch
try {
fileNames = reader.getFileNames(parentPath);
} catch (IMapStorageException e) {
LOG.warn("WAL listing failed for {}", parentPath, e.getCause());
return Collections.emptyList(); // or retry
} Prevention
- Check directory existence and permissions before listing
- Monitor storage backend health (NameNode/S3/OSS availability)
- Remember the message typo: path won't appear in the message; log it separately
When it happens
Trigger: Calling DefaultReader.getFileNames(parentPath) when the directory doesn't exist, is not readable, or the underlying filesystem (HDFS/S3/OSS) raises IOException during listing.
Common situations: WAL directory deleted or never created; wrong path in storage config; permission issues on the storage backend; network partition to HDFS/S3/OSS mid-read.
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
- create new current writer failed, parent path is %s
- Unsupported type ${type}
- Circular condition chain detected: '%s' already exists in th
- Condition for option '%s' has a null operator
- Unsupported convert ${value.getClass()} to LocalTime, typeDe
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/4a368e5cecf942cb.
Report an issue: GitHub.