{"record":{"id":"a3edd1c1b54aabae","repo":"t8y2/dbx","slug":"s-is-not-a-regular-file-s","errorCode":null,"errorMessage":"%s is not a regular file: %s","messagePattern":"(.+?) is not a regular file: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/kerberos.go","lineNumber":622,"sourceCode":"\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":604,"sourceCodeEnd":635,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/kerberos.go#L604-L635","documentation":"requireRegularFile rejects paths that resolve to something other than a regular file (directory, socket, FIFO, device). Kerberos keytabs, ccaches, and krb5 configs must be readable regular files; stat succeeds but Mode().IsRegular() is false.","triggerScenarios":"os.Stat succeeds but info.Mode().IsRegular() is false — e.g. a configured path points at a directory, a Unix socket, or a device node.","commonSituations":"Pointing the keytab/ccache option at a directory instead of the file inside it; KRB5CCNAME set to a directory such as DIR::/run/user/1000 without the file component; misconfigured Kubernetes volume mounts where the path is the mount point, not the secret key file.","solutions":["Point the option at the file itself, not its containing directory or mount point.","For directory-type ccache collections, set KRB5CCNAME to the specific primary ccache file path.","Check with file/stat <path> what the path actually resolves to."],"exampleFix":"// before\nccache: /var/run/secrets/kerberos  (a directory)\n// after\nccache: /var/run/secrets/kerberos/krb5cc_0","handlingStrategy":"validation","validationCode":"info, err := os.Stat(path)\nif err != nil { return err }\nif !info.Mode().IsRegular() {\n    return fmt.Errorf(\"%s must be a regular file, got mode %v\", path, info.Mode())\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"is not a regular file\") {\n    return fmt.Errorf(\"check that %s points to the file, not a directory or socket\", path)\n}","preventionTips":["Point config at file paths, never directories or mount roots.","Add a startup lint that stat-checks all Kerberos paths and requires Mode().IsRegular().","For KRB5CCNAME use FILE:/path form or the concrete primary ccache file."],"tags":["kerberos","filesystem","configuration"],"backgroundTag":"path-is-not-a-file","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"}