{"record":{"id":"d4ebefe66bcf5fa9","repo":"ClementTsang/bottom","slug":"missing-mount-point","errorCode":null,"errorMessage":"missing mount point","messagePattern":"missing mount point","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"src/collection/disks/unix/linux/partition.rs","lineNumber":137,"sourceCode":"impl FromStr for Partition {\n    type Err = anyhow::Error;\n\n    fn from_str(line: &str) -> anyhow::Result<Partition> {\n        // Example: `/dev/sda3 /home ext4 rw,relatime,data=ordered 0 0`\n        let mut parts = line.trim_start().splitn(5, ' ');\n\n        let device = match parts.next() {\n            Some(\"none\") => None,\n            Some(device) => Some(device.to_string()),\n            None => {\n                bail!(\"missing device\");\n            }\n        };\n\n        let mount_point = match parts.next() {\n            Some(mount_point) => PathBuf::from(fix_mount_point(mount_point)),\n            None => {\n                bail!(\"missing mount point\");\n            }\n        };\n        let fs_type = match parts.next() {\n            Some(fs) => FileSystem::from_str(fs)?,\n            _ => {\n                bail!(\"missing filesystem type\");\n            }\n        };\n\n        Ok(Partition {\n            device,\n            mount_point,\n            fs_type,\n        })\n    }\n}\n\n#[expect(dead_code)]","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/ClementTsang/bottom/blob/b77d3175028849824e987c35177e8f61450d72e7/src/collection/disks/unix/linux/partition.rs#L119-L155","documentation":"This error means the FromStr parser for Partition failed while parsing a line from /proc/mounts (e.g. '/dev/sda3 /home ext4 rw,relatime,data=ordered 0 0'): after reading the first whitespace-separated field as the device, the iterator produced no second field, so no mount point exists in the line. It fires only when the caller passes a malformed line with fewer than 2 space-separated tokens (a generic sentinel guard in the splitn(5, ' ') parsing loop) — i.e. a truncated or empty line, not a real /proc/mounts entry. Callers should treat it as malformed-input data for one mount entry; parsing continues/propagates via anyhow::Result.","triggerScenarios":"An empty or blank line, or a line with only one token (e.g. '/dev/sda3'), is passed to Partition::from_str, so splitn yields no second field for the mount point.","commonSituations":"Reading /proc/mounts returns a stray blank or truncated line (e.g. buffered trailing newline), or hand-crafted/partial input is fed to the parser during tests or debugging.","solutions":["Skip blank or short lines when reading /proc/mounts instead of parsing them.","Log the offending line and continue so one bad mount entry doesn't abort the whole disk collection.","If constructing Partition manually, always supply device, mount point, and filesystem type fields."],"exampleFix":"Skip empty/short lines before parsing: for line in content.lines().filter(|l| !l.trim().is_empty() && l.split_whitespace().count() >= 3) { let p = Partition::from_str(line)?; }","handlingStrategy":"validation","validationCode":"// Require at least 4 fields before parsing a mounts line\nlet ok = line.split_whitespace().count() >= 4;\nif !ok { eprintln!(\"malformed mounts line: {line:?}\"); }","typeGuard":null,"tryCatchPattern":"let p = Partition::from_str(line)\n    .map_err(|e| { log::debug!(\"bad mount entry {line:?}: {e}\"); e })\n    .unwrap_or_else(|_| Partition::default_placeholder());","preventionTips":["Validate mounts-line field count before parsing","Verify the source of mount data isn't truncated","Skip-and-log instead of failing the entire harvest"],"tags":["linux","parsing","mounts"],"backgroundTag":"schema-validation-failed","analyzedSha":"b77d3175028849824e987c35177e8f61450d72e7","analyzedAt":"2026-09-07T14:53:21.246Z","contentChangedAt":"2026-09-07T14:53:21.246Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}