{"record":{"id":"9c995f450c90d1e9","repo":"t8y2/dbx","slug":"invalid-cassandra-jaas-config-path-w","errorCode":null,"errorMessage":"invalid Cassandra JAAS config path: %w","messagePattern":"invalid Cassandra JAAS config path: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/kerberos.go","lineNumber":94,"sourceCode":"var (\n\tjaasBlockPattern  = regexp.MustCompile(`(?is)\\bCassandraJavaClient\\s*\\{(.*?)\\}\\s*;`)\n\tjaasModulePattern = regexp.MustCompile(`(?is)\\bcom\\.sun\\.security\\.auth\\.module\\.Krb5LoginModule\\b(.*?);`)\n\tjaasOptionPattern = regexp.MustCompile(`(?is)([A-Za-z][A-Za-z0-9_-]*)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s;]+))`)\n)\n\nfunc defaultKerberosConfig() kerberosConfig {\n\treturn kerberosConfig{\n\t\tserviceName: \"cassandra\",\n\t\tqop:         \"auth\",\n\t}\n}\n\nfunc (config *kerberosConfig) finalize(username, password string) error {\n\tconfig.applyJavaSystemProperties()\n\tif config.jaasConfigPath != \"\" {\n\t\tpath, err := normalizeLocalFilePath(config.jaasConfigPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid Cassandra JAAS config path: %w\", err)\n\t\t}\n\t\tconfig.jaasConfigPath = path\n\t\tif err := config.applyJAASConfig(path); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tconfig.applyKerberosConfigEnvironment()\n\tif config.configPath == \"\" {\n\t\tconfig.configPath = defaultKerberosConfigPath()\n\t}\n\tpath, err := normalizeLocalFilePath(firstPathListEntry(config.configPath))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid Kerberos config path: %w\", err)\n\t}\n\tconfig.configPath = path\n\tif err := requireRegularFile(\"Kerberos config\", config.configPath); err != nil {\n\t\treturn err\n\t}","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/kerberos.go#L76-L112","documentation":"kerberosConfig.finalize throws this when normalizeLocalFilePath fails on the configured JAAS config path (jaasConfigPath), typically because the path is not a local file path (e.g. a URL, remote reference, or otherwise malformed). The driver requires a JAAS login config file on local disk to extract Krb5LoginModule options.","triggerScenarios":"Setting cassandra-auth JAAS config to a non-local path (http://..., classpath:..., or an empty/malformed path) and creating a Kerberos auth provider, which calls finalize.","commonSituations":"Copying Java driver settings where the JAAS config was referenced via java.security.auth.login.config with a classpath or URL form, or pointing at a file that does not exist locally.","solutions":["Set jaasConfigPath to an absolute or relative local filesystem path to an existing JAAS file, e.g. /etc/cassandra/jaas.conf.","Remove any URL or classpath scheme from the path.","Verify the file exists and is readable at the configured path before constructing the provider."],"exampleFix":"// before\nconfig.JAASConfigPath = \"classpath:jaas.conf\"\n\n// after\nconfig.JAASConfigPath = \"/etc/cassandra/jaas.conf\"","handlingStrategy":"validation","validationCode":"func validateJAASPath(p string) error {\n    if p == \"\" {\n        return nil\n    }\n    if strings.Contains(p, \"://\") || strings.HasPrefix(p, \"classpath:\") {\n        return fmt.Errorf(\"JAAS config must be a local filesystem path, got %q\", p)\n    }\n    info, err := os.Stat(p)\n    if err != nil {\n        return fmt.Errorf(\"JAAS config not found: %w\", err)\n    }\n    if info.IsDir() {\n        return fmt.Errorf(\"JAAS config path is a directory: %s\", p)\n    }\n    return nil\n}","typeGuard":"func isLocalFilePath(p string) bool {\n    return p != \"\" && !strings.Contains(p, \"://\") && filepath.IsAbs(p) || filepath.Base(p) == p || strings.HasPrefix(p, \"/\")\n}","tryCatchPattern":"if err := provider.Finalize(user, pass); err != nil {\n    var perr *fs.PathError\n    if errors.As(err, &perr) || strings.Contains(err.Error(), \"invalid Cassandra JAAS config path\") {\n        return fmt.Errorf(\"check jaasConfigPath points to a local jaas.conf file: %w\", err)\n    }\n    return err\n}","preventionTips":["Always use absolute local paths for JAAS config files.","Never use classpath:, http:, or other URI schemes.","Verify the file exists (os.Stat) before constructing the Kerberos provider."],"tags":["kerberos","configuration","file-path","jaas"],"backgroundTag":"invalid-file-path","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"}