apache/hadoop · error · MetricsException
The flush interval property must be at least 1 minute. Value
Error message
The flush interval property must be at least 1 minute. Value was ${rollInterval} What it means
After parsing, the roll interval is converted to milliseconds and must be at least 60000 (one minute); smaller values throw 'The flush interval property must be at least 1 minute. Value was <rollInterval>'. Since the smallest supported unit is minutes, the realistic way to hit this is a zero quantity — the sink deliberately forbids sub-minute or disabled rolling.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSink.java:394
break;
case "d":
case "day":
case "days":
millis = TimeUnit.DAYS.toMillis(rollIntervalInt);
break;
default:
throw new MetricsException("Unrecognized unit for flush interval: "
+ flushUnit + ". Must be one of: minute, hour, day");
}
}
} else {
throw new MetricsException("Unrecognized flush interval: "
+ rollInterval + ". Must be a number followed by an optional unit."
+ " The unit must be one of: minute, hour, day");
}
if (millis < 60000) {
throw new MetricsException("The flush interval property must be "
+ "at least 1 minute. Value was " + rollInterval);
}
return millis;
}
/**
* Return the property value if it's non-negative and throw an exception if
* it's not.
*
* @param key the property key
* @param defaultValue the default value
*/
private long getNonNegative(String key, int defaultValue) {
int flushOffsetIntervalMillis = properties.getInt(key, defaultValue);
if (flushOffsetIntervalMillis < 0) {
throw new MetricsException("The " + key + " property must be "View on GitHub (pinned to 2add963021)
Solutions
- Set at least roll-interval=1minute
- If the goal was to disable the sink, remove the sink configuration lines instead of zeroing roll-interval
- If a very frequent roll was intended, reconsider — the minimum is a hard floor of 1 minute by design
Example fix
# before *.sink.rolling.roll-interval=0 # interpreted as 0 hours -> below 1-minute floor # after *.sink.rolling.roll-interval=1minute
Defensive patterns
Strategy: validation
Validate before calling
// after parsing per sink rules, before applying:
if (parsedMillis < 60000L) {
throw new IllegalArgumentException("roll-interval '" + rollInterval
+ "' resolves to " + parsedMillis + " ms; minimum is 1 minute");
} Try / catch
try {
sink.init(subsetConf);
} catch (MetricsException e) {
// 'must be at least 1 minute' — almost always roll-interval=0
LOG.error("roll-interval '{}' below the 1-minute floor; set 1minute or larger", rollInterval, e);
} Prevention
- Never zero roll-interval to 'disable' rolling — remove the sink config instead
- Treat 1minute as the smallest legal value when templating configs
- Remember a bare number is hours, so '0' means zero hours and always trips this check
When it happens
Trigger: roll-interval=0 (bare number = 0 hours = 0 ms), roll-interval=0minutes, roll-interval=0day.
Common situations: Trying to disable rolling by setting the interval to 0; intending a sub-minute interval; leaving the property set to 0 in a template.
Related errors
- The ${key} property must be non-negative. Value was ${value}
- Failed to create ${basePath}[source=${source}, allow-append=
- Unrecognized flush interval: ${rollInterval}. Must be a numb
- Unrecognized unit for flush interval: ${flushUnit}. Must be
- The supplied filesystem base path URI is not a valid URI: ${
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/ce305f526b0c5a40.
Report an issue: GitHub.