hashicorp/nomad · error
failed to determine mount point for %s
Error message
failed to determine mount point for %s
What it means
diskInfo runs `df -k` (with -P on linux) against the absolute path to find the mount point and total capacity. If the df command returns an error (non-zero exit, missing binary, signal), the fingerprinter returns this message.
Source
Thrown at client/fingerprint/storage_unix.go:36
// the total bytes available on the file system.
func (f *StorageFingerprint) diskInfo(path string) (volume string, total uint64, err error) {
absPath, err := filepath.Abs(path)
if err != nil {
return "", 0, fmt.Errorf("failed to determine absolute path for %s", path)
}
// Use -k to standardize the output values between darwin and linux
var dfArgs string
if runtime.GOOS == "linux" {
// df on linux needs the -P option to prevent linebreaks on long filesystem paths
dfArgs = "-kP"
} else {
dfArgs = "-k"
}
mountOutput, err := exec.Command("df", dfArgs, absPath).Output()
if err != nil {
return "", 0, fmt.Errorf("failed to determine mount point for %s", absPath)
}
// Output looks something like:
// Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on
// /dev/disk1 487385240 423722532 63406708 87% 105994631 15851677 87% /
// [0] volume [1] capacity [2] SKIP [3] free
lines := strings.Split(string(mountOutput), "\n")
if len(lines) < 2 {
return "", 0, fmt.Errorf("failed to parse `df` output; expected at least 2 lines")
}
fields := strings.Fields(lines[1])
if len(fields) < 4 {
return "", 0, fmt.Errorf("failed to parse `df` output; expected at least 4 columns")
}
volume = fields[0]
total, err = strconv.ParseUint(fields[1], 10, 64)
if err != nil {
return "", 0, fmt.Errorf("failed to parse storage.bytestotal size in kilobytes")View on GitHub (pinned to 482b49bf1a)
Solutions
- Install/restore the `df` utility (coreutils) in the host image or container.
- Confirm the path exists and is accessible: df -k /path/to/dir.
- Check the client process PATH includes standard binary directories.
- Provide a static DiskTotalMB override in the storage fingerprint config.
Example fix
// before (Dockerfile) FROM scratch // after (Dockerfile) FROM alpine RUN apk add --no-cache coreutils
Defensive patterns
Strategy: validation
Validate before calling
if _, err := exec.LookPath("df"); err != nil {
return fmt.Errorf("df not available on PATH; install coreutils or set DiskTotalMB override")
}
if _, err := os.Stat(path); err != nil {
return fmt.Errorf("path %s must exist before df", path)
} Try / catch
if err := fp.Fingerprint(req); err != nil {
if strings.Contains(err.Error(), "failed to determine mount point") {
log.Printf("df failed: %v", err)
return nil
}
return err
} Prevention
- Install coreutils (df) in host/container images.
- Verify `df -k <path>` exits 0 during image/build validation.
- Ensure the client process PATH includes /bin, /usr/bin.
- Pre-set DiskTotalMB when df availability cannot be guaranteed.
When it happens
Trigger: exec.Command("df", dfArgs, absPath).Output() errors: df not installed, path does not exist (df exits 1), permission denied, or the binary cannot be executed.
Common situations: Minimal containers/images without coreutils' df; alloc dir deleted before fingerprinting; PATH problems for the Nomad client process; non-executable df binary.
Related errors
- failed to parse `df` output; expected at least 2 lines
- failed to parse `df` output; expected at least 4 columns
- failed to parse storage.bytestotal size in kilobytes
- unable to get CWD from filesystem: %s
- failed to determine disk space for %s: %v
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/f969de94ad0e3c65.
Report an issue: GitHub.