t8y2/dbx · error

resolve Kerberos server name: Cassandra host is unavailable

Error message

resolve Kerberos server name: Cassandra host is unavailable

What it means

Returned by kerberosServerName when no explicit kerberosservername is configured and the driver cannot supply a Cassandra host (host is nil) from which to reverse-derive the service principal name. Without a host there is no basis for the SPN, so Kerberos authenticator construction fails.

Source

Thrown at agents/drivers/cassandra-go/kerberos.go:426

	binary.LittleEndian.PutUint32(checksum[20:24], flags)
	return checksum
}

func kerberosQOPIncludesAuth(value string) bool {
	for _, qop := range strings.Split(value, ",") {
		if strings.EqualFold(strings.TrimSpace(qop), "auth") {
			return true
		}
	}
	return false
}

func kerberosServerName(config kerberosConfig, host *gocql.HostInfo) (string, error) {
	if config.serverName != "" {
		return strings.TrimSuffix(strings.TrimSpace(config.serverName), "."), nil
	}
	if host == nil {
		return "", fmt.Errorf("resolve Kerberos server name: Cassandra host is unavailable")
	}
	address := host.ConnectAddress()
	if address != nil {
		names, err := net.LookupAddr(address.String())
		if err == nil && len(names) > 0 {
			return strings.TrimSuffix(strings.TrimSpace(names[0]), "."), nil
		}
	}
	hostname, _, err := net.SplitHostPort(host.HostnameAndPort())
	if err == nil && hostname != "" && net.ParseIP(hostname) == nil {
		return strings.TrimSuffix(hostname, "."), nil
	}
	return "", fmt.Errorf("resolve Kerberos server name for Cassandra host %s; configure kerberosservername explicitly", host.ConnectAddressAndPort())
}

func (config *kerberosConfig) applyJavaSystemProperties() {
	if config.jaasConfigPath == "" {
		config.jaasConfigPath = javaSystemProperty("java.security.auth.login.config")

View on GitHub (pinned to c0390bff16)

Solutions

  1. Set kerberosservername explicitly in the connection configuration to the Cassandra host's FQDN
  2. Ensure the driver received at least one host from contact points so reverse lookup is possible
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at agents/drivers/cassandra-go/kerberos.go:426 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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