{"record":{"id":"f969de94ad0e3c65","repo":"hashicorp/nomad","slug":"failed-to-determine-mount-point-for-s","errorCode":null,"errorMessage":"failed to determine mount point for %s","messagePattern":"failed to determine mount point for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/fingerprint/storage_unix.go","lineNumber":36,"sourceCode":"// the total bytes available on the file system.\nfunc (f *StorageFingerprint) diskInfo(path string) (volume string, total uint64, err error) {\n\tabsPath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn \"\", 0, fmt.Errorf(\"failed to determine absolute path for %s\", path)\n\t}\n\n\t// Use -k to standardize the output values between darwin and linux\n\tvar dfArgs string\n\tif runtime.GOOS == \"linux\" {\n\t\t// df on linux needs the -P option to prevent linebreaks on long filesystem paths\n\t\tdfArgs = \"-kP\"\n\t} else {\n\t\tdfArgs = \"-k\"\n\t}\n\n\tmountOutput, err := exec.Command(\"df\", dfArgs, absPath).Output()\n\tif err != nil {\n\t\treturn \"\", 0, fmt.Errorf(\"failed to determine mount point for %s\", absPath)\n\t}\n\t// Output looks something like:\n\t//\tFilesystem 1024-blocks      Used Available Capacity   iused    ifree %iused  Mounted on\n\t//\t/dev/disk1   487385240 423722532  63406708    87% 105994631 15851677   87%   /\n\t//\t[0] volume [1] capacity [2] SKIP  [3] free\n\tlines := strings.Split(string(mountOutput), \"\\n\")\n\tif len(lines) < 2 {\n\t\treturn \"\", 0, fmt.Errorf(\"failed to parse `df` output; expected at least 2 lines\")\n\t}\n\tfields := strings.Fields(lines[1])\n\tif len(fields) < 4 {\n\t\treturn \"\", 0, fmt.Errorf(\"failed to parse `df` output; expected at least 4 columns\")\n\t}\n\tvolume = fields[0]\n\n\ttotal, err = strconv.ParseUint(fields[1], 10, 64)\n\tif err != nil {\n\t\treturn \"\", 0, fmt.Errorf(\"failed to parse storage.bytestotal size in kilobytes\")","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/fingerprint/storage_unix.go#L18-L54","documentation":"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.","triggerScenarios":"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.","commonSituations":"Minimal containers/images without coreutils' df; alloc dir deleted before fingerprinting; PATH problems for the Nomad client process; non-executable df binary.","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."],"exampleFix":"// before (Dockerfile)\nFROM scratch\n// after (Dockerfile)\nFROM alpine\nRUN apk add --no-cache coreutils","handlingStrategy":"validation","validationCode":"if _, err := exec.LookPath(\"df\"); err != nil {\n\treturn fmt.Errorf(\"df not available on PATH; install coreutils or set DiskTotalMB override\")\n}\nif _, err := os.Stat(path); err != nil {\n\treturn fmt.Errorf(\"path %s must exist before df\", path)\n}","typeGuard":null,"tryCatchPattern":"if err := fp.Fingerprint(req); err != nil {\n\tif strings.Contains(err.Error(), \"failed to determine mount point\") {\n\t\tlog.Printf(\"df failed: %v\", err)\n\t\treturn nil\n\t}\n\treturn err\n}","preventionTips":["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."],"tags":["filesystem","exec","df","fingerprinting"],"backgroundTag":"df-command-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}