{"record":{"id":"d9aa2736a367c2db","repo":"hashicorp/nomad","slug":"mount-point-detection-failed-for-volume-s-v","errorCode":null,"errorMessage":"mount point detection failed for volume (%s): %v","messagePattern":"mount point detection failed for volume \\((.+?)\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/pluginmanager/csimanager/volume.go","lineNumber":449,"sourceCode":"// and then validates that the path is not already a mount point for e.g an\n// existing volume stage.\n//\n// Returns whether the directory is a pre-existing mountpoint, the staging path,\n// and any errors that occurred.\nfunc (v *volumeManager) ensureStagingDir(vol *structs.CSIVolume, usage *UsageOptions) (string, bool, error) {\n\thostStagingPath := v.stagingDirForVolume(v.mountRoot, vol.Namespace, vol.ID, usage)\n\n\t// Make the staging path, owned by the Nomad User\n\tif err := os.MkdirAll(hostStagingPath, 0700); err != nil && !os.IsExist(err) {\n\t\treturn \"\", false, fmt.Errorf(\"failed to create staging directory for volume (%s): %v\", vol.ID, err)\n\n\t}\n\n\t// Validate that it is not already a mount point\n\tm := mount.New()\n\tisNotMount, err := m.IsNotAMountPoint(hostStagingPath)\n\tif err != nil {\n\t\treturn \"\", false, fmt.Errorf(\"mount point detection failed for volume (%s): %v\", vol.ID, err)\n\t}\n\n\treturn hostStagingPath, !isNotMount, nil\n}\n\n// ensureAllocDir attempts to create a directory for use when publishing a volume\n// and then validates that the path is not already a mount point (e.g when reattaching\n// to existing allocs).\n//\n// Returns whether the directory is a pre-existing mountpoint, the publish path,\n// and any errors that occurred.\nfunc (v *volumeManager) ensureAllocDir(vol *structs.CSIVolume, alloc *structs.Allocation, usage *UsageOptions) (string, bool, error) {\n\tallocPath := v.allocDirForVolume(v.mountRoot, vol.ID, alloc.ID)\n\n\t// Make the alloc path, owned by the Nomad User\n\tif err := os.MkdirAll(allocPath, 0700); err != nil && !os.IsExist(err) {\n\t\treturn \"\", false, fmt.Errorf(\"failed to create allocation directory for volume (%s): %v\", vol.ID, err)\n\t}","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/pluginmanager/csimanager/volume.go#L431-L467","documentation":"After creating the staging directory, ensureStagingDir calls mount.IsNotAMountPoint to verify whether the path is already a mount point. If that detection itself fails, stageVolume aborts with this error carrying the wrapped OS/mount error.","triggerScenarios":"m.IsNotAMountPoint(hostStagingPath) returns an error during stageVolume — typically a failure of the underlying stat/mountinfo read (e.g. /proc/mounts or mountinfo unavailable) on the host staging path.","commonSituations":"Node running in a restricted container without /proc/self/mountinfo; corrupted procfs; custom builds where the mount util is unsupported on the OS (e.g. Windows); permission issues reading mount tables.","solutions":["Verify /proc/self/mountinfo (or the OS mount table) is readable inside the Nomad client's environment","Run the Nomad agent on a supported OS/without overly restrictive procfs masking (docker: do not mask /proc)","Inspect the wrapped %v error for the exact syscall failure and address the OS-level cause","Restart the client node if procfs is in a bad state, then retry the volume staging"],"exampleFix":"// docker run before (procfs masked causing mount detection failure)\ndocker run --read-only nomad ...\n// after\ndocker run nomad ...  # do not mask /proc/self/mountinfo; run on supported host OS","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(\"/proc/self/mountinfo\"); err != nil {\n    return fmt.Errorf(\"mount table unreadable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"path, isMount, err := vm.EnsureStagingDir(vol, usage)\nif err != nil {\n    if strings.Contains(err.Error(), \"mount point detection failed\") {\n        // inspect/repair /proc mount table, then retry\n    }\n    return err\n}","preventionTips":["Do not mask /proc/self/mountinfo in containerized Nomad clients","Run Nomad on supported OS versions for the mount helper","Alert on client logs containing 'mount point detection failed'"],"tags":["csi","nomad","mount","filesystem","staging"],"backgroundTag":"mount-point-detection-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"}