apache/cassandra · error · ConfigurationException
MINIMUM_NAME_SIZE_CONFIG_OPTION has to be at least DEFAULT_M
Error message
MINIMUM_NAME_SIZE_CONFIG_OPTION has to be at least DEFAULT_MINIMUM_NAME_SIZE and at most MAXIMUM_NAME_SIZE
What it means
UUIDRoleNameGenerator.validateParameters() throws this ConfigurationException when the 'minimum_name_size' config option is outside the allowed range: below DEFAULT_MINIMUM_NAME_SIZE or above MAXIMUM_NAME_SIZE. It runs at generator construction/registration time, so a bad generator config prevents the role-name generator from being usable.
Source
Thrown at src/java/org/apache/cassandra/db/guardrails/UUIDRoleNameGenerator.java:119
name = name.substring(0, size);
name = enrich(NAME_PREFIX_KEY, name, options);
name = enrich(NAME_SUFFIX_KEY, name, options);
return name;
}
@Nonnull
@Override
public CustomGuardrailConfig getParameters()
{
return config;
}
@Override
public void validateParameters() throws ConfigurationException
{
if (minimumNameSize < DEFAULT_MINIMUM_NAME_SIZE || minimumNameSize > MAXIMUM_NAME_SIZE)
throw new ConfigurationException(MINIMUM_NAME_SIZE_CONFIG_OPTION + " has to be at least " + DEFAULT_MINIMUM_NAME_SIZE + " and at most " + MAXIMUM_NAME_SIZE);
}
private String enrich(String key, String generatedValue, Map<String, Object> options)
{
if (options == null || options.isEmpty())
return generatedValue;
if (options.containsKey(key))
{
Object value = options.get(key);
if (value == null)
throw new IllegalArgumentException("Value of " + key + " cannot be null.");
if (!(value instanceof String))
throw new IllegalArgumentException("Value of " + key + " is not a string.");
if (NAME_PREFIX_KEY.equals(key))View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Set minimum_name_size between DEFAULT_MINIMUM_NAME_SIZE and MAXIMUM_NAME_SIZE (36)
- Read the message numbers: first value is the lower bound, second the upper bound; clamp your config into that range
- If you want short names, use the smallest allowed minimum rather than 0
Example fix
// before minimum_name_size: 0 // after minimum_name_size: 4
Defensive patterns
Strategy: validation
Validate before calling
void checkMin(int minimumNameSize) {
if (minimumNameSize < DEFAULT_MINIMUM_NAME_SIZE || minimumNameSize > MAXIMUM_NAME_SIZE)
throw new IllegalArgumentException("minimum_name_size must be in [" + DEFAULT_MINIMUM_NAME_SIZE + "," + MAXIMUM_NAME_SIZE + "]");
} Try / catch
try {
generator.validateParameters();
} catch (ConfigurationException e) {
if (e.getMessage().startsWith("minimum_name_size")) {
// clamp config value into [DEFAULT_MINIMUM_NAME_SIZE, 36] and recreate
} else throw e;
} Prevention
- Clamp minimum_name_size into [DEFAULT_MINIMUM_NAME_SIZE, 36] in your config loader
- Never use 0 or negative values to mean 'no minimum'
- Document the valid range next to the config key
When it happens
Trigger: Configuring UUIDRoleNameGenerator with minimum_name_size smaller than the built-in default minimum or larger than MAXIMUM_NAME_SIZE (36 for a UUID string), then calling validateParameters during creation.
Common situations: Operators setting minimum_name_size=0 or negative values believing 0 means 'unconstrained', or typos like 360 instead of 36 when intending to cap name length.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- Invalid data rate: value must be non-negative
- Invalid guardrails configuration:
- %s can not be greater than %s
- %s can not be bigger than %s
- %s can not be equal to %s. You set %s and %s respectively.
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/c3af631f1a13e784.
Report an issue: GitHub.