t8y2/dbx · error

invalid usekeytab option: %w

Error message

invalid usekeytab option: %w

What it means

The 'usekeytab' (or 'kerberosusekeytab') URL parameter enables Kerberos keytab authentication and must be a boolean parseable by strconv.ParseBool; anything else returns this wrapped error. The parsed value is stored along with a useKeytabSet marker so defaults can be distinguished.

Source

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

			config.kerberos.password = value
		case "kerberosservice", "kerberosservicename", "saslprotocol":
			config.kerberos.serviceName = value
		case "kerberosservername", "saslservername":
			config.kerberos.serverName = value
		case "kerberosauthorizationid", "authorizationid":
			config.kerberos.authorizationID = value
		case "kerberosqop", "saslqop":
			config.kerberos.qop = value
		case "kerberosdisablepafxfast", "disablepafxfast":
			disabled, err := strconv.ParseBool(value)
			if err != nil {
				return fmt.Errorf("invalid disablepafxfast option: %w", err)
			}
			config.kerberos.disablePAFXFAST = disabled
		case "kerberosusekeytab", "usekeytab":
			enabled, err := strconv.ParseBool(value)
			if err != nil {
				return fmt.Errorf("invalid usekeytab option: %w", err)
			}
			config.kerberos.useKeytab = enabled
			config.kerberos.useKeytabSet = true
		case "kerberosuseticketcache", "useticketcache":
			enabled, err := strconv.ParseBool(value)
			if err != nil {
				return fmt.Errorf("invalid useticketcache option: %w", err)
			}
			config.kerberos.useTicketCache = enabled
			config.kerberos.useTicketCacheSet = true
		case "compliancemode":
			// JDBC compliance modes only alter java.sql behavior. The native DBX
			// JSON-RPC contract already defines statement and transaction behavior.
		default:
			return fmt.Errorf("unsupported Cassandra URL parameter: %s", rawKey)
		}
	}
	return nil

View on GitHub (pinned to c0390bff16)

Solutions

  1. Set usekeytab=true or usekeytab=false (or 1/0, t/f variants)
  2. Remove the parameter to use the default keytab behavior
  3. Inspect the wrapped strconv error to identify the offending token

Example fix

// before
cassandra://127.0.0.1/myks?usekeytab=enabled
// after
cassandra://127.0.0.1/myks?usekeytab=true
Defensive patterns

Strategy: validation

Validate before calling

if v := q.Get("usekeytab"); v != "" {
	if _, err := strconv.ParseBool(v); err != nil {
		return errors.New("usekeytab must be a boolean")
	}
}

Try / catch

if err := parseCassandraConfig(dsn); err != nil {
	if strings.Contains(err.Error(), "usekeytab option") {
		return parseCassandraConfig(coerceBoolParam(dsn, "usekeytab"))
	}
	return err
}

Prevention

When it happens

Trigger: DSN contains usekeytab=<value> where value is not a strconv.ParseBool literal, e.g. usekeytab=enabled or usekeytab=1 (with a trailing space).

Common situations: Service account setups with keytab files following Java-style 'enabled' flags; config generators emitting YAML-ish booleans (yes/no); whitespace from copy-paste.

Related errors


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