{"record":{"id":"bdb7d70776df13b1","repo":"t8y2/dbx","slug":"read-s-s-w","errorCode":null,"errorMessage":"read %s %s: %w","messagePattern":"read (.+?) (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/kerberos.go","lineNumber":619,"sourceCode":"\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 \"\"\n}\n","sourceCodeStart":601,"sourceCodeEnd":635,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/kerberos.go#L601-L635","documentation":"requireRegularFile wraps the os.Stat error when the configured path cannot be inspected — the file does not exist, the path has a bad component, or permission is denied. The %w wrap preserves the underlying *PathError so you can see the OS reason (no such file or directory, permission denied, etc.).","triggerScenarios":"finalize/selectCCacheCredential/selectKeytabCredential call requireRegularFile and os.Stat(path) returns an error: nonexistent file, dangling symlink, missing parent directory, or a path the process cannot traverse.","commonSituations":"Typo in the keytab or ccache path; file mounted into a container at a different location; running as a non-root service account that cannot read /etc/krb5.keytab; SELinux/AppArmor blocking access; a kinit-produced ccache deleted between setting KRB5CCNAME and connecting.","solutions":["Read the wrapped OS error to see whether it is 'no such file or directory' or 'permission denied' and fix accordingly.","Verify the path with ls -l <path> as the same user the driver runs as.","Create or regenerate the missing file (kinit, ktutil, mount the secret volume).","Fix filesystem permissions (chown/chmod) so the service account can read the file."],"exampleFix":"// before\npath: /etc/krb5.keytab (file only readable by root; driver runs as cassandra)\n// after\n$ chown cassandra:cassandra /etc/krb5.keytab && chmod 640 /etc/krb5.keytab","handlingStrategy":"validation","validationCode":"if path != \"\" {\n    if _, err := os.Stat(path); err != nil {\n        return fmt.Errorf(\"precheck: cannot stat %s: %w\", path, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"var pathErr *fs.PathError\nif errors.As(err, &pathErr) && errors.Is(pathErr.Err, fs.ErrNotExist) {\n    // regenerate or fix the configured path\n}","preventionTips":["Run the driver under the same OS user that owns the Kerberos files.","Mount secrets to fixed paths and assert their presence in readiness probes.","Check errors.As(*fs.PathError) to distinguish not-exist from permission-denied."],"tags":["kerberos","filesystem","permissions"],"backgroundTag":"file-not-found","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"}