t8y2/dbx · error
too many Cassandra reconnection policy parameters
Error message
too many Cassandra reconnection policy parameters
What it means
parseReconnectionPolicy accepts at most two delay parameters (base delay and max delay). A third or subsequent parameter triggers this error because the supported policies (constant, exponential) take no more than two long arguments.
Source
Thrown at agents/drivers/cassandra-go/config.go:555
name = name[:open]
}
policy := strings.ToLower(strings.TrimSpace(name))
baseDelay := time.Second
maxDelay := 60 * time.Second
if parameters != "" {
parts := strings.Split(parameters, ",")
for index, part := range parts {
part = strings.TrimSpace(strings.ReplaceAll(strings.ToLower(part), "(long)", ""))
seconds, err := strconv.Atoi(part)
if err != nil || seconds < 0 {
return "", 0, 0, fmt.Errorf("invalid Cassandra reconnection policy delay: %s", part)
}
if index == 0 {
baseDelay = time.Duration(seconds) * time.Second
} else if index == 1 {
maxDelay = time.Duration(seconds) * time.Second
} else {
return "", 0, 0, fmt.Errorf("too many Cassandra reconnection policy parameters")
}
}
}
switch policy {
case "", "constantreconnectionpolicy":
return "constant", baseDelay, baseDelay, nil
case "exponentialreconnectionpolicy":
return "exponential", baseDelay, maxDelay, nil
default:
return "", 0, 0, fmt.Errorf("unsupported Cassandra reconnection policy: %s", value)
}
}
func simpleClassName(value string) string {
value = strings.TrimSpace(value)
prefix := value
if open := strings.IndexByte(prefix, '('); open >= 0 {
prefix = prefix[:open]View on GitHub (pinned to c0390bff16)
Solutions
- Remove extra parameters, keeping only base delay (and max delay for exponential)
- Use only the two arguments supported by ConstantReconnectionPolicy(baseDelay, maxDelay) or ExponentialReconnectionPolicy(baseDelay, maxDelay)
- Drop the policy arguments entirely to use defaults
Example fix
// before reconnectionPolicy = ConstantReconnectionPolicy(1000, 10000, 60000) // after reconnectionPolicy = ConstantReconnectionPolicy(1000, 10000)
Defensive patterns
Strategy: validation
Validate before calling
func validArgCount(args string) bool {
args = strings.TrimSpace(args)
if args == "" {
return true
}
return len(strings.Split(args, ",")) <= 2
} Try / catch
if _, _, _, err := parseReconnectionPolicy(raw); err != nil {
return fmt.Errorf("max 2 args (baseDelay, maxDelay): %w", err)
} Prevention
- Limit ConstantReconnectionPolicy/ExponentialReconnectionPolicy to two arguments
- Copy argument lists only from these two supported classes
- Check for duplicated/extra commas in HOCON values
When it happens
Trigger: Passing a reconnection policy with 3+ comma-separated parameters, e.g. ConstantReconnectionPolicy(1000, 10000, 60000).
Common situations: Copying an argument list from a different/custom policy class that has more parameters, or accidentally repeating a parameter in HOCON config.
Related errors
- invalid Cassandra reconnection policy delay: %s
- unsupported Cassandra reconnection policy: %s
- invalid requesttimeout: %w
- invalid connecttimeout: %w
- protocolversion must be between 3 and 5
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/441be0240eea5513.
Report an issue: GitHub.