{"record":{"id":"fc974cbdd4fa5c6a","repo":"prometheus/node_exporter","slug":"getmntinfo-failed-fc974c","errorCode":null,"errorMessage":"getmntinfo() failed","messagePattern":"getmntinfo\\(\\) failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/filesystem_macos.go","lineNumber":67,"sourceCode":"import \"C\"\n\nimport (\n\t\"errors\"\n\t\"unsafe\"\n)\n\nconst (\n\tdefMountPointsExcluded = \"^/(dev)($|/)\"\n\tdefFSTypesExcluded     = \"^devfs$\"\n\treadOnly               = 0x1 // MNT_RDONLY\n)\n\n// Expose filesystem fullness.\nfunc (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {\n\tvar mntbuf *C.struct_statfs\n\tcount := C.getmntinfo(&mntbuf, C.MNT_NOWAIT)\n\tif count == 0 {\n\t\treturn nil, errors.New(\"getmntinfo() failed\")\n\t}\n\n\tmnt := (*[1 << 20]C.struct_statfs)(unsafe.Pointer(mntbuf))\n\tstats = []filesystemStats{}\n\tfor i := 0; i < int(count); i++ {\n\t\tmountpoint := C.GoString(&mnt[i].f_mntonname[0])\n\t\tif c.mountPointFilter.ignored(mountpoint) {\n\t\t\tc.logger.Debug(\"Ignoring mount point\", \"mountpoint\", mountpoint)\n\t\t\tcontinue\n\t\t}\n\n\t\tdevice := C.GoString(&mnt[i].f_mntfromname[0])\n\t\tfstype := C.GoString(&mnt[i].f_fstypename[0])\n\t\tif c.fsTypeFilter.ignored(fstype) {\n\t\t\tc.logger.Debug(\"Ignoring fs type\", \"type\", fstype)\n\t\t\tcontinue\n\t\t}\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/filesystem_macos.go#L49-L85","documentation":"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).","triggerScenarios":"Thrown at collector/filesystem_macos.go:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17ddd77c59ba27e1508e9f7894b1e55b44d6aed3","analyzedAt":"2026-09-07T17:54:06.211Z","contentChangedAt":"2026-09-07T17:54:06.211Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}