{"record":{"id":"61671c76098b84f7","repo":"t8y2/dbx","slug":"s-path-is-empty","errorCode":null,"errorMessage":"%s path is empty","messagePattern":"(.+?) path is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/kerberos.go","lineNumber":615,"sourceCode":"\t}\n\tcurrentUser, err := user.Current()\n\tif err == nil && currentUser.Uid != \"\" {\n\t\treturn filepath.Join(os.TempDir(), \"krb5cc_\"+currentUser.Uid)\n\t}\n\treturn \"\"\n}\n\nfunc firstPathListEntry(value string) string {\n\tentries := filepath.SplitList(value)\n\tif len(entries) == 0 {\n\t\treturn value\n\t}\n\treturn entries[0]\n}\n\nfunc requireRegularFile(label, path string) error {\n\tif path == \"\" {\n\t\treturn fmt.Errorf(\"%s path is empty\", label)\n\t}\n\tinfo, err := os.Stat(path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read %s %s: %w\", label, path, err)\n\t}\n\tif !info.Mode().IsRegular() {\n\t\treturn fmt.Errorf(\"%s is not a regular file: %s\", label, path)\n\t}\n\treturn nil\n}\n\nfunc firstNonEmpty(values ...string) string {\n\tfor _, value := range values {\n\t\tif value != \"\" {\n\t\t\treturn value\n\t\t}\n\t}\n\treturn \"\"","sourceCodeStart":597,"sourceCodeEnd":633,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/kerberos.go#L597-L633","documentation":"requireRegularFile validates a labeled filesystem path (keytab, ccache, krb5 config) before use. It reports that the configured path string is empty, meaning the corresponding configuration option was never set and no default could be resolved. The driver cannot stat a file without a path, so it fails fast with a clear message.","triggerScenarios":"finalize, selectCCacheCredential, or selectKeytabCredential invokes requireRegularFile with path == \"\" — e.g. the kerberos config/keytab/ccache option is absent from the connect params and firstNonEmpty found no value among the config path, KRB5CCNAME, or environment fallbacks.","commonSituations":"Running in a container or minimal image where KRB5CCNAME/KRB5_CONFIG are unset and no default /etc/krb5.conf exists; forgetting to set the kerberos options in the DSN or connect params; a shell variable used in the config that expands to the empty string.","solutions":["Set the relevant configuration option (krb5 config path, keytab path, or ccache path) explicitly in the connect parameters.","Export the expected environment variable (KRB5_CONFIG, KRB5CCNAME) before starting the process.","Ensure the credential file exists at the default location (e.g. /etc/krb5.conf) if you rely on defaults."],"exampleFix":"// before\nparams: {\"host\":\"cassandra.example.com\"} // no kerberos config path\n// after\nparams: {\"host\":\"cassandra.example.com\", \"kerberosconfigpath\":\"/etc/krb5.conf\", \"kerberoskeytab\":\"/etc/cassandra.keytab\"}","handlingStrategy":"validation","validationCode":"if cfg.KerberosConfigPath == \"\" {\n    if _, err := os.Stat(\"/etc/krb5.conf\"); err != nil {\n        return fmt.Errorf(\"no kerberos config path configured and /etc/krb5.conf missing\")\n    }\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.HasSuffix(err.Error(), \"path is empty\") {\n    return fmt.Errorf(\"kerberos options missing in connect params: %w\", err)\n}","preventionTips":["Fail at application startup if KRB5_CONFIG/KRB5CCNAME and config options are all unset in Kerberos mode.","Document required kerberos.* connect params next to the DSN.","Check container images include a default krb5.conf or pass the path explicitly."],"tags":["kerberos","configuration","file-path"],"backgroundTag":"missing-path-configuration","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"}