prometheus/node_exporter · error
getmntinfo() failed
Error message
getmntinfo() failed
What it means
The BSD/macOS getmntinfo(3) C call returned a mount count of 0, which the collector treats as failure to enumerate mounted filesystems. GetStats depends entirely on this list; without it no node_filesystem metrics can be produced. Note getmntinfo also returns 0 on genuine empty mount tables, so this can fire spuriously in restricted environments (e.g. some containers).
Solutions
- Verify mounts exist on the host (run `mount`); on macOS this failing usually indicates a libc memory allocation failure inside getmntinfo.
- If running in a container or sandbox, mount /proc-like filesystems or run without the isolation that hides mount tables, or disable the filesystem collector (--collector.filesystem).
- Retry scraping; transient getmntinfo failures (ENOMEM) usually resolve on the next scrape.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at collector/filesystem_macos.go:67 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of prometheus/node_exporter@17ddd77c59 (2026-09-07).
Data as JSON: /api/errors/fc974cbdd4fa5c6a.
Report an issue: GitHub.
Appendix: source
Thrown at collector/filesystem_macos.go:67
import "C"
import (
"errors"
"unsafe"
)
const (
defMountPointsExcluded = "^/(dev)($|/)"
defFSTypesExcluded = "^devfs$"
readOnly = 0x1 // MNT_RDONLY
)
// Expose filesystem fullness.
func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
var mntbuf *C.struct_statfs
count := C.getmntinfo(&mntbuf, C.MNT_NOWAIT)
if count == 0 {
return nil, errors.New("getmntinfo() failed")
}
mnt := (*[1 << 20]C.struct_statfs)(unsafe.Pointer(mntbuf))
stats = []filesystemStats{}
for i := 0; i < int(count); i++ {
mountpoint := C.GoString(&mnt[i].f_mntonname[0])
if c.mountPointFilter.ignored(mountpoint) {
c.logger.Debug("Ignoring mount point", "mountpoint", mountpoint)
continue
}
device := C.GoString(&mnt[i].f_mntfromname[0])
fstype := C.GoString(&mnt[i].f_fstypename[0])
if c.fsTypeFilter.ignored(fstype) {
c.logger.Debug("Ignoring fs type", "type", fstype)
continue
}
View on GitHub (pinned to 17ddd77c59)