t8y2/dbx · error

invalid debug option

Error message

invalid debug option: %w

What it means

This error is returned when the 'debug' URL parameter in a Cassandra connection URL cannot be parsed as a boolean by strconv.ParseBool. The library validates every URL parameter value before storing it in cassandraConfig, so a malformed boolean value aborts config parsing. The underlying strconv error is wrapped so the developer sees the original parse failure.

Solutions

  1. Set the debug parameter to one of strconv.ParseBool's accepted values: 1, t, T, true, TRUE, True, 0, f, F, false, FALSE, False
  2. Remove the debug parameter entirely if the default is acceptable
  3. Log or print the wrapped %w error to see exactly what strconv choked on and correct that token in the URL

Example fix

// before
cassandra://127.0.0.1/myks?debug=yes
// after
cassandra://127.0.0.1/myks?debug=true
Defensive patterns

Strategy: validation

Validate before calling

func validBoolParam(v string) bool {
	_, err := strconv.ParseBool(v)
	return err == nil
}
// if q.Get("debug") != "" && !validBoolParam(q.Get("debug")) { fix URL }

Try / catch

if err := parseCassandraConfig(dsn); err != nil {
	var pe *strconv.NumError
	if errors.As(err, &pe) {
		return fmt.Errorf("fix boolean param %q in DSN: %w", pe.Num, err)
	}
	return err
}

Prevention

When it happens

Trigger: Calling parseCassandraConfig with a DSN containing debug=<not-a-bool>, e.g. cassandra://host/db?debug=yes%20please or debug=on1. strconv.ParseBool only accepts 1,t,T,TRUE,true,True,0,f,F,FALSE,false,False.

Common situations: Hand-editing connection URLs and using words like 'enabled', 'yes', or 'on'; copy-pasting JDBC-style boolean values that are not Go-parseable booleans; templating that renders an empty or malformed debug value.

Related errors


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

Appendix: source

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

			enabled, err := strconv.ParseBool(value)
			if err != nil {
				return fmt.Errorf("invalid tcpnodelay option: %w", err)
			}
			config.tcpNoDelay = enabled
		case "keepalive":
			enabled, err := strconv.ParseBool(value)
			if err != nil {
				return fmt.Errorf("invalid keepalive option: %w", err)
			}
			config.keepAlive = enabled
		case "user":
			config.username = value
		case "password":
			config.password = value
		case "debug":
			enabled, err := strconv.ParseBool(value)
			if err != nil {
				return fmt.Errorf("invalid debug option: %w", err)
			}
			config.debug = enabled
		case "retries":
			count, err := strconv.Atoi(value)
			if err != nil || count < 0 || count > 1000 {
				return fmt.Errorf("retries must be between 0 and 1000")
			}
			config.retryCount = count
		case "retry":
			policy, err := normalizeRetryPolicy(value)
			if err != nil {
				return err
			}
			config.retryPolicy = policy
		case "reconnection":
			policy, baseDelay, maxDelay, err := parseReconnectionPolicy(value)
			if err != nil {
				return err

View on GitHub (pinned to c0390bff16)