t8y2/dbx · error

%s is not a regular file: %s

Error message

%s is not a regular file: %s

What it means

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.

Source

Thrown at agents/drivers/cassandra-go/kerberos.go:622

func firstPathListEntry(value string) string {
	entries := filepath.SplitList(value)
	if len(entries) == 0 {
		return value
	}
	return entries[0]
}

func requireRegularFile(label, path string) error {
	if path == "" {
		return fmt.Errorf("%s path is empty", label)
	}
	info, err := os.Stat(path)
	if err != nil {
		return fmt.Errorf("read %s %s: %w", label, path, err)
	}
	if !info.Mode().IsRegular() {
		return fmt.Errorf("%s is not a regular file: %s", label, path)
	}
	return nil
}

func firstNonEmpty(values ...string) string {
	for _, value := range values {
		if value != "" {
			return value
		}
	}
	return ""
}

View on GitHub (pinned to c0390bff16)

Solutions

  1. Point the option at the file itself, not its containing directory or mount point.
  2. For directory-type ccache collections, set KRB5CCNAME to the specific primary ccache file path.
  3. Check with file/stat <path> what the path actually resolves to.

Example fix

// before
ccache: /var/run/secrets/kerberos  (a directory)
// after
ccache: /var/run/secrets/kerberos/krb5cc_0
Defensive patterns

Strategy: validation

Validate before calling

info, err := os.Stat(path)
if err != nil { return err }
if !info.Mode().IsRegular() {
    return fmt.Errorf("%s must be a regular file, got mode %v", path, info.Mode())
}

Try / catch

if err != nil && strings.Contains(err.Error(), "is not a regular file") {
    return fmt.Errorf("check that %s points to the file, not a directory or socket", path)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/a3edd1c1b54aabae. Report an issue: GitHub.