{"record":{"id":"8b9b8eebe213a4b9","repo":"t8y2/dbx","slug":"invalid-kerberos-config-path-w","errorCode":null,"errorMessage":"invalid Kerberos config path: %w","messagePattern":"invalid Kerberos config path: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/kerberos.go","lineNumber":107,"sourceCode":"func (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}\n\tkrbConfig, err := krb5config.Load(config.configPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load Kerberos config %s: %w\", config.configPath, err)\n\t}\n\tif config.serviceName == \"\" {\n\t\tconfig.serviceName = \"cassandra\"\n\t}\n\tif !kerberosQOPIncludesAuth(config.qop) {\n\t\treturn fmt.Errorf(\"Cassandra Kerberos currently supports SASL QOP auth only, got %s\", config.qop)\n\t}\n\tconfig.qop = \"auth\"\n\tif config.principal == \"\" {\n\t\tconfig.principal = strings.TrimSpace(username)","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/kerberos.go#L89-L125","documentation":"kerberosConfig.finalize throws this when normalizeLocalFilePath fails on the Kerberos krb5.conf path (after environment/system-property resolution and taking the first entry of a path list). The driver needs a local krb5.conf to load realms and KDC settings via krb5config.Load.","triggerScenarios":"finalize resolving configPath (from settings, KRB5_CONFIG env, or java.security.krb5.conf system property, defaulting to defaultKerberosConfigPath()) to a value that is not a valid local file path.","commonSituations":"KRB5_CONFIG containing a colon-separated list where the first entry is malformed, pointing at a URL/URI-style location, or relying on a default path in a minimal container where /etc/krb5.conf cannot be normalized.","solutions":["Set the Kerberos config path to a plain local filesystem path to an existing krb5.conf, e.g. /etc/krb5.conf.","Check KRB5_CONFIG and java.security.krb5.conf environment/system properties for malformed first entries and fix or unset them.","Ensure the default krb5.conf exists at the expected system location or explicitly configure the path."],"exampleFix":"// before\nKRB5_CONFIG=\"profile:/etc/krb5.conf\"\n\n// after\nKRB5_CONFIG=\"/etc/krb5.conf\"","handlingStrategy":"validation","validationCode":"func validateKrb5Path(p string) error {\n    first := strings.Split(p, string(os.PathListSeparator))[0]\n    if strings.Contains(first, \"://\") {\n        return fmt.Errorf(\"Kerberos config must be a local filesystem path, got %q\", first)\n    }\n    if _, err := os.Stat(first); err != nil {\n        return fmt.Errorf(\"krb5.conf not found at %q: %w\", first, err)\n    }\n    return nil\n}","typeGuard":"func isPlainLocalPath(p string) bool {\n    return p != \"\" && !strings.Contains(p, \"://\") && !strings.Contains(p, \" \")\n}","tryCatchPattern":"if err := cfg.Finalize(user, pass); err != nil {\n    if strings.Contains(err.Error(), \"invalid Kerberos config path\") {\n        return fmt.Errorf(\"check KRB5_CONFIG / configPath resolves to a local krb5.conf: %w\", err)\n    }\n    return err\n}","preventionTips":["Keep KRB5_CONFIG simple: one local path, or verify the first list entry exists.","Set the path explicitly rather than relying on default locations in containers.","Confirm the default krb5.conf exists in your runtime image."],"tags":["kerberos","configuration","file-path","krb5"],"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-14T00:17:10.932Z"}