apache/hadoop · error · IOException
Illegal file pattern: {}
Error message
Illegal file pattern: {} What it means
Error "Illegal file pattern: {}" thrown in apache/hadoop.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobFilter.java:71
/**
* Creates a glob filter with the specified file pattern and an user filter.
*
* @param filePattern the file pattern.
* @param filter user filter in addition to the glob pattern.
* @throws IOException thrown if the file pattern is incorrect.
*/
public GlobFilter(String filePattern, PathFilter filter) throws IOException {
init(filePattern, filter);
}
void init(String filePattern, PathFilter filter) throws IOException {
try {
userFilter = filter;
pattern = new GlobPattern(filePattern);
}
catch (PatternSyntaxException e) {
// Existing code expects IOException startWith("Illegal file pattern")
throw new IOException("Illegal file pattern: "+ e.getMessage(), e);
}
}
public boolean hasPattern() {
return pattern.hasWildcard();
}
@Override
public boolean accept(Path path) {
return pattern.matches(path.getName()) && userFilter.accept(path);
}
}
View on GitHub (pinned to 2add963021)
Solutions
- Fix the glob pattern syntax (unbalanced brackets or bad escapes).
- Test the pattern against the expected PathFilter rules before submitting the job.
When it happens
Trigger: Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobFilter.java:71 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/d9a92b65b78630bf.
Report an issue: GitHub.