apache/hadoop · error · HdfsCompatIllegalArgumentException
cannot get class name for suite " + this.suiteName + ", conf
Error message
cannot get class name for suite " + this.suiteName + ", configuration " + key + " is not properly set.
What it means
HdfsCompatCommand.initSuite resolves -suite: first against the built-in default suites, then via the configuration key hadoop.compatibility.suite.<suiteName>.classname. If that key is unset or empty, it throws HdfsCompatIllegalArgumentException, and the message names the exact configuration key it looked for so you can fix it directly.
Source
Thrown at hadoop-tools/hadoop-compat-bench/src/main/java/org/apache/hadoop/fs/compat/common/HdfsCompatCommand.java:78
if (api != null) {
report.merge(api.apply());
}
if (shell != null) {
report.merge(shell.apply());
}
return report;
}
private void initSuite() throws ReflectiveOperationException {
Map<String, HdfsCompatSuite> defaultSuites = getDefaultSuites();
this.suite = defaultSuites.getOrDefault(this.suiteName, null);
if (this.suite != null) {
return;
}
String key = "hadoop.compatibility.suite." + this.suiteName + ".classname";
final String suiteClassName = conf.get(key, null);
if ((suiteClassName == null) || suiteClassName.isEmpty()) {
throw new HdfsCompatIllegalArgumentException(
"cannot get class name for suite " + this.suiteName +
", configuration " + key + " is not properly set.");
}
Constructor<?> ctor = suiteClassName.getClass().getConstructor();
ctor.setAccessible(true);
Object suiteObj = ctor.newInstance();
if (suiteObj instanceof HdfsCompatSuite) {
this.suite = (HdfsCompatSuite) suiteObj;
} else {
throw new HdfsCompatIllegalArgumentException(
"class name " + suiteClassName + " must be an" +
" implementation of " + HdfsCompatSuite.class.getName());
}
if (suite.getSuiteName() == null || suite.getSuiteName().isEmpty()) {
throw new HdfsCompatIllegalArgumentException(
"suite " + suiteClassName + " suiteName is empty");
}
for (HdfsCompatSuite defaultSuite : defaultSuites.values()) {View on GitHub (pinned to 2add963021)
Solutions
- Set the key named in the message: hadoop.compatibility.suite.mysuite.classname = com.example.MyCompatSuite, in a config file that is actually loaded by the tool run
- Check exact spelling and case of the suite name in both the -suite argument and the derived key
- Or use one of the built-in default suite names, which need no registration
Example fix
# before hadoop ... HdfsCompatTool -uri hdfs://nn/ -suite mysuite # -> cannot get class name for suite mysuite, configuration # hadoop.compatibility.suite.mysuite.classname is not properly set. # after: suites.xml <property> <name>hadoop.compatibility.suite.mysuite.classname</name> <value>com.example.MyCompatSuite</value> </property> hadoop ... HdfsCompatTool -uri hdfs://nn/ -suite mysuite -conf suites.xml
Defensive patterns
Strategy: validation
Validate before calling
String key = "hadoop.compatibility.suite." + suiteName + ".classname";
if (!defaultSuiteNames.contains(suiteName) && conf.get(key, "").isEmpty()) {
throw new IllegalArgumentException(
"Suite '" + suiteName + "' is not built-in and " + key
+ " is not set; register the suite or use a default suite name");
} Try / catch
Catch HdfsCompatIllegalArgumentException around the tool run; if the message contains 'is not properly set', print the named configuration key and the exact command to register the suite before retrying.
Prevention
- Ship suite registrations in one XML file that travels with the suite jar and always pass it via -conf
- Fail fast on unknown suite names in wrapper scripts instead of deferring to the tool's reflective lookup
When it happens
Trigger: Running with -suite mysuite where mysuite is not a default suite name and hadoop.compatibility.suite.mysuite.classname is absent from the effective configuration (config file not passed to the tool, suite name misspelled so the derived key does not match, or the XML file not on the classpath).
Common situations: Custom suite registered in a suites.xml that was never passed via -conf or placed in the classpath; case mismatch between the -suite argument and the config key; sharing runbooks between environments where only one has the registration.
Related errors
- class name " + suiteClassName + " must be an implementation
- suite " + suiteClassName + " suiteName is empty
- suite " + suiteClassName + " suiteName conflicts with defaul
- suite " + suiteClassName + " is empty for both API and SHELL
- No more entry in " + f
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/d263493d4eddc0c5.
Report an issue: GitHub.