apache/hadoop · error · IllegalArgumentException
Cannot parse ssQuota: {}
Error message
Cannot parse ssQuota: {} What it means
Thrown by dfsrouteradmin -setQuota when the token after -ssQuota cannot be parsed by StringUtils.TraditionalBinaryPrefix.string2long. That parser accepts a whole number with an optional traditional binary prefix (k, m, g, t, p, e -- e.g. 1536, 100GB, 5t) and nothing else. Fractional values, unit-only tokens, or embedded spaces make setQuota throw this IllegalArgumentException before contacting the Router.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java:995
long ssQuota = HdfsConstants.QUOTA_DONT_SET;
String mount = parameters[i++];
while (i < parameters.length) {
if (parameters[i].equals("-nsQuota")) {
i++;
try {
nsQuota = Long.parseLong(parameters[i]);
} catch (Exception e) {
throw new IllegalArgumentException(
"Cannot parse nsQuota: " + parameters[i]);
}
} else if (parameters[i].equals("-ssQuota")) {
i++;
try {
ssQuota = StringUtils.TraditionalBinaryPrefix
.string2long(parameters[i]);
} catch (Exception e) {
throw new IllegalArgumentException(
"Cannot parse ssQuota: " + parameters[i]);
}
} else {
throw new IllegalArgumentException(
"Invalid argument : " + parameters[i]);
}
i++;
}
if (nsQuota <= 0 || ssQuota <= 0) {
throw new IllegalArgumentException(
"Input quota value should be a positive number.");
}
if (nsQuota == HdfsConstants.QUOTA_DONT_SET &&
ssQuota == HdfsConstants.QUOTA_DONT_SET) {
throw new IllegalArgumentException(View on GitHub (pinned to 2add963021)
Solutions
- Use a whole number with an optional binary prefix: -ssQuota 1536GB, -ssQuota 5t, or plain bytes -ssQuota 1073741824
- Replace decimal amounts with the nearest whole-unit value (1.5TB -> 1536GB)
- Quote the argument and keep it a single token with no spaces or thousands separators
- Verify with the usage text: hdfs dfsrouteradmin -help setQuota
Example fix
# before hdfs dfsrouteradmin -setQuota /mount -ssQuota 1.5TB # after hdfs dfsrouteradmin -setQuota /mount -ssQuota 1536GB
Defensive patterns
Strategy: validation
Validate before calling
# accept integer or integer+binary suffix (k,m,g,t,p,e), reject decimals/units-only if ! [[ "$SS" =~ ^-?[0-9]+[kKmMgGtTpPeE]?$ ]]; then echo "ssQuota must be like 1536GB or 1073741824 (no decimals)" >&2; exit 2 fi
Prevention
- Convert 1.5-style values to whole units before submitting (1.5TB -> 1536GB)
- Keep the value one token: no spaces, no thousands separators
- Prefer bytes for machine-generated quotas
When it happens
Trigger: -setQuota /mount -ssQuota 1.5TB (decimals unsupported); -ssQuota GB (unit without a number); -ssQuota '100 GB' (space splits it into two tokens, 'GB' then fails); -ssQuota ten.
Common situations: Operators wanting '1.5 TB' and not realizing only whole numbers with binary prefixes parse; shell scripts passing unquoted or truncated values; copy-paste from spreadsheets that inserts separators (1,024).
Related errors
- Cannot parse nsQuota: {}
- Invalid argument : {}
- Input quota value should be a positive number.
- Must specify at least one of -nsQuota and -ssQuota.
- "{}" is not a valid value for a quota.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/ab65852ad7f07e88.
Report an issue: GitHub.