t8y2/dbx · error

unsupported Cassandra retry policy: %s

Error message

unsupported Cassandra retry policy: %s

What it means

normalizeRetryPolicy maps Java-driver retry policy class names to internal policy names. Values not matching a known policy (after trimming to the simple class name and lowercasing) are rejected with this error.

Source

Thrown at agents/drivers/cassandra-go/config.go:511

	if err != nil || milliseconds < 1 {
		return 0, fmt.Errorf("expected duration or positive milliseconds")
	}
	return time.Duration(milliseconds) * time.Millisecond, nil
}

func normalizeRetryPolicy(value string) (string, error) {
	name := strings.ToLower(simpleClassName(value))
	switch name {
	case "", "defaultretrypolicy", "simpleretrypolicy":
		return "simple", nil
	case "fallthroughretrypolicy":
		return "fallthrough", nil
	case "downgradingconsistencyretrypolicy":
		return "downgrading", nil
	case "exponentialbackoffretrypolicy":
		return "exponential", nil
	default:
		return "", fmt.Errorf("unsupported Cassandra retry policy: %s", value)
	}
}

func normalizeLoadBalancingPolicy(value string) (string, error) {
	name := strings.ToLower(simpleClassName(value))
	switch name {
	case "", "basicloadbalancingpolicy", "dcinferringloadbalancingpolicy", "defaultloadbalancingpolicy":
		return "default", nil
	case "roundrobinpolicy":
		return "round_robin", nil
	case "dcawareroundrobinpolicy":
		return "dc_aware", nil
	case "tokenawarepolicy":
		return "token_aware", nil
	default:
		return "", fmt.Errorf("unsupported Cassandra loadbalancing policy: %s", value)
	}
}

View on GitHub (pinned to c0390bff16)

Solutions

  1. Use one of the supported policies: DefaultRetryPolicy, FallthroughRetryPolicy, DowngradingConsistencyRetryPolicy, ExponentialBackoffRetryPolicy
  2. Provide the full class name or simple class name; casing is normalized automatically
  3. Remove the retryPolicy option to use the library default
  4. Implement a custom policy only if the library exposes an extension point; otherwise choose the closest built-in

Example fix

// before
url = "cassandra://host:9042/ks?retryPolicy=com.datastax.driver.core.policies.MyRetryPolicy"
// after
url = "cassandra://host:9042/ks?retryPolicy=DefaultRetryPolicy"
Defensive patterns

Strategy: validation

Validate before calling

var supportedRetryPolicies = map[string]bool{
	"defaultretrypolicy": true, "fallthroughretrypolicy": true,
	"downgradingconsistencyretrypolicy": true, "exponentialbackoffretrypolicy": true,
}
func validRetryPolicy(v string) bool {
	return supportedRetryPolicies[strings.ToLower(v)]
}

Try / catch

p, err := normalizeRetryPolicy(value)
if err != nil {
	return fmt.Errorf("%w; supported: Default, Fallthrough, DowngradingConsistency, ExponentialBackoff", err)
}

Prevention

When it happens

Trigger: applyCassandraURLParams or applyJavaDriverHOCON receives a retryPolicy value whose simple class name is not one of the recognized cases (e.g. DefaultRetryPolicy, FallthroughRetryPolicy, DowngradingConsistencyRetryPolicy, ExponentialBackoffRetryPolicy).

Common situations: Specifying a custom RetryPolicy implementation from application code, a typo like "retryPolicy=Default", or a policy class from a different driver version.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/452dcc0bea7a1e52. Report an issue: GitHub.