{"record":{"id":"4df8a99431ca05ca","repo":"hashicorp/nomad","slug":"failed-to-determine-disk-space-for-s-v","errorCode":null,"errorMessage":"failed to determine disk space for %s: %v","messagePattern":"failed to determine disk space for (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/fingerprint/storage.go","lineNumber":44,"sourceCode":"\treturn fp\n}\n\nfunc (f *StorageFingerprint) Fingerprint(req *FingerprintRequest, resp *FingerprintResponse) error {\n\tcfg := req.Config\n\n\t// Guard against unset AllocDir\n\tstorageDir := cfg.AllocDir\n\tif storageDir == \"\" {\n\t\tvar err error\n\t\tstorageDir, err = os.Getwd()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to get CWD from filesystem: %s\", err)\n\t\t}\n\t}\n\n\tvolume, total, err := f.diskInfo(storageDir)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to determine disk space for %s: %v\", storageDir, err)\n\t}\n\n\tif cfg.DiskTotalMB > 0 {\n\t\ttotal = uint64(cfg.DiskTotalMB) * bytesPerMegabyte\n\t}\n\n\tresp.AddAttribute(\"unique.storage.volume\", volume)\n\tresp.AddAttribute(\"unique.storage.bytestotal\", strconv.FormatUint(total, 10))\n\n\t// set the disk size for the response\n\tresp.NodeResources = &structs.NodeResources{\n\t\tDisk: structs.NodeDiskResources{\n\t\t\tDiskMB: int64(total / bytesPerMegabyte),\n\t\t},\n\t}\n\tresp.Detected = true\n\n\treturn nil","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/fingerprint/storage.go#L26-L62","documentation":"The storage fingerprinter could not determine total disk space for the storage directory. It calls f.diskInfo(storageDir) (which shells out to `df` on Unix) and wraps any diskInfo failure with the directory path in this message.","triggerScenarios":"Fingerprint on the storage fingerprinter where diskInfo fails: the path cannot be made absolute, the `df` command fails, or `df` output cannot be parsed (see storage_unix.go errors 905-909).","commonSituations":"AllocDir points at a nonexistent path; `df` missing from PATH or non-executable; exotic filesystems whose df output breaks parsing; paths with unusual characters.","solutions":["Check the wrapped %v error to see which underlying diskInfo step failed.","Ensure the storage/alloc directory exists and is accessible.","Verify `df` is installed and works manually: df -k <storageDir>.","Set DiskTotalMB in the fingerprint config to override auto-detection."],"exampleFix":"// before\n# alloc_dir = \"/nonexistent/path\"\n// after\nclient {\n  alloc_dir = \"/opt/nomad/data/alloc\"\n}","handlingStrategy":"validation","validationCode":"info, err := os.Stat(storageDir)\nif err != nil || !info.IsDir() {\n\treturn fmt.Errorf(\"storage dir %s must exist before fingerprinting\", storageDir)\n}","typeGuard":null,"tryCatchPattern":"if err := fp.Fingerprint(req); err != nil {\n\tif strings.Contains(err.Error(), \"failed to determine disk space for\") {\n\t\tlog.Printf(\"disk fingerprint skipped: %v\", err)\n\t\treturn nil\n\t}\n\treturn err\n}","preventionTips":["Ensure the alloc/storage directory exists and is readable before client start.","Verify `df -k <dir>` works on the target host image.","Set DiskTotalMB override when df-based detection is unreliable.","Include coreutils/df in container images used for Nomad clients."],"tags":["filesystem","disk-space","fingerprinting"],"backgroundTag":"disk-info-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"}