t8y2/dbx · error

invalid useTicketCache in Cassandra JAAS config: %w

Error message

invalid useTicketCache in Cassandra JAAS config: %w

What it means

Same class of failure as useKeyTab: the `useTicketCache` option in the Krb5LoginModule JAAS entry is not a boolean strconv.ParseBool understands. The library validates this flag strictly when parsing the JAAS config.

Source

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

		config.principal = options["principal"]
	}
	if config.keytabPath == "" {
		config.keytabPath = options["keytab"]
	}
	if config.ccachePath == "" {
		config.ccachePath = options["ticketcache"]
	}
	if value, ok := options["usekeytab"]; ok {
		config.useKeytab, err = strconv.ParseBool(value)
		if err != nil {
			return fmt.Errorf("invalid useKeyTab in Cassandra JAAS config: %w", err)
		}
		config.useKeytabSet = true
	}
	if value, ok := options["useticketcache"]; ok {
		config.useTicketCache, err = strconv.ParseBool(value)
		if err != nil {
			return fmt.Errorf("invalid useTicketCache in Cassandra JAAS config: %w", err)
		}
		config.useTicketCacheSet = true
	}
	return nil
}

func javaSystemProperty(name string) string {
	pattern := regexp.MustCompile(`(?:^|\s)-D` + regexp.QuoteMeta(name) + `=(?:"([^"]*)"|'([^']*)'|(\S+))`)
	for _, environmentName := range []string{"JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "JDK_JAVA_OPTIONS"} {
		match := pattern.FindStringSubmatch(os.Getenv(environmentName))
		if len(match) == 4 {
			return firstNonEmpty(match[1], match[2], match[3])
		}
	}
	return ""
}

func normalizeKerberosCachePath(raw string) (string, error) {

View on GitHub (pinned to c0390bff16)

Solutions

  1. Use a strconv.ParseBool-compatible value: true/false/1/0/T/F/TRUE/FALSE.
  2. Strip quotes, semicolons, and whitespace around the value.
  3. Delete the useTicketCache option and configure ticket-cache behavior through the driver's config instead of JAAS.

Example fix

// before
com.sun.security.auth.module.Krb5LoginModule required useTicketCache="yes";
// after
com.sun.security.auth.module.Krb5LoginModule required useTicketCache=true;
Defensive patterns

Strategy: validation

Validate before calling

func validBoolOption(v string) bool {
	_, err := strconv.ParseBool(strings.TrimSpace(strings.Trim(v, "\"'")))
	return err == nil
}

Try / catch

if err := client.Finalize(); err != nil {
	if strings.Contains(err.Error(), "invalid useTicketCache") {
		log.Fatalf("useTicketCache in %s must be true/false/1/0", jaasPath)
	}
	return err
}

Prevention

When it happens

Trigger: applyJAASConfig reads a `useTicketCache=<value>` option whose value is outside strconv.ParseBool's accepted set (e.g. `yes`, `on`, quoted or whitespace-polluted values).

Common situations: Copying Java JAAS examples that use `useTicketCache=true` with odd quoting; hand-written values like `True ` with trailing space; using `yes/no` idioms common in other config formats.

Related errors


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