{"record":{"id":"28d93c49cd99679c","repo":"t8y2/dbx","slug":"invalid-useticketcache-in-cassandra-jaas-config","errorCode":null,"errorMessage":"invalid useTicketCache in Cassandra JAAS config: %w","messagePattern":"invalid useTicketCache in Cassandra JAAS config: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/kerberos.go","lineNumber":494,"sourceCode":"\t\tconfig.principal = options[\"principal\"]\n\t}\n\tif config.keytabPath == \"\" {\n\t\tconfig.keytabPath = options[\"keytab\"]\n\t}\n\tif config.ccachePath == \"\" {\n\t\tconfig.ccachePath = options[\"ticketcache\"]\n\t}\n\tif value, ok := options[\"usekeytab\"]; ok {\n\t\tconfig.useKeytab, err = strconv.ParseBool(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid useKeyTab in Cassandra JAAS config: %w\", err)\n\t\t}\n\t\tconfig.useKeytabSet = true\n\t}\n\tif value, ok := options[\"useticketcache\"]; ok {\n\t\tconfig.useTicketCache, err = strconv.ParseBool(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid useTicketCache in Cassandra JAAS config: %w\", err)\n\t\t}\n\t\tconfig.useTicketCacheSet = true\n\t}\n\treturn nil\n}\n\nfunc javaSystemProperty(name string) string {\n\tpattern := regexp.MustCompile(`(?:^|\\s)-D` + regexp.QuoteMeta(name) + `=(?:\"([^\"]*)\"|'([^']*)'|(\\S+))`)\n\tfor _, environmentName := range []string{\"JAVA_TOOL_OPTIONS\", \"_JAVA_OPTIONS\", \"JDK_JAVA_OPTIONS\"} {\n\t\tmatch := pattern.FindStringSubmatch(os.Getenv(environmentName))\n\t\tif len(match) == 4 {\n\t\t\treturn firstNonEmpty(match[1], match[2], match[3])\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc normalizeKerberosCachePath(raw string) (string, error) {","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/kerberos.go#L476-L512","documentation":"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.","triggerScenarios":"applyJAASConfig reads a `useTicketCache=<value>` option whose value is outside strconv.ParseBool's accepted set (e.g. `yes`, `on`, quoted or whitespace-polluted values).","commonSituations":"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.","solutions":["Use a strconv.ParseBool-compatible value: true/false/1/0/T/F/TRUE/FALSE.","Strip quotes, semicolons, and whitespace around the value.","Delete the useTicketCache option and configure ticket-cache behavior through the driver's config instead of JAAS."],"exampleFix":"// before\ncom.sun.security.auth.module.Krb5LoginModule required useTicketCache=\"yes\";\n// after\ncom.sun.security.auth.module.Krb5LoginModule required useTicketCache=true;","handlingStrategy":"validation","validationCode":"func validBoolOption(v string) bool {\n\t_, err := strconv.ParseBool(strings.TrimSpace(strings.Trim(v, \"\\\"'\")))\n\treturn err == nil\n}","typeGuard":null,"tryCatchPattern":"if err := client.Finalize(); err != nil {\n\tif strings.Contains(err.Error(), \"invalid useTicketCache\") {\n\t\tlog.Fatalf(\"useTicketCache in %s must be true/false/1/0\", jaasPath)\n\t}\n\treturn err\n}","preventionTips":["Use only true/false/1/0 for useTicketCache.","Strip quotes/semicolons/whitespace around JAAS values.","Validate JAAS booleans in CI before deployment.","Prefer driver-level config options over JAAS flags where supported."],"tags":["kerberos","cassandra","config","parsing"],"backgroundTag":"jaas-config-invalid","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}