astrid-runtime/astrid · error

FUSE service mountpoint is malformed

Error message

FUSE service mountpoint is malformed

What it means

validate_mountpoint checks that the requested mountpoint is an absolute path, contains no ParentDir ("..") components, and has a parent directory. If any of these path-safety conditions fail, the launch is rejected because a relative or traversal-containing mountpoint cannot be safely resolved inside the private mount namespace.

Solutions

  1. Make the mountpoint an absolute path (e.g. /run/astrid/mounts/<resource>) before calling validate_launch
  2. Normalize the path and remove any ".." components (use std::path::absolute / components-based normalization) prior to launch
  3. Never mount at "/" or another parentless path; pick a dedicated subdirectory
  4. Fix the config/env source of the mountpoint so it cannot contain relative segments

Example fix

// before
let mountpoint = "../run/mount";

// after
let mountpoint = std::path::absolute("/run/astrid/mounts/demo")?;
Defensive patterns

Strategy: validation

Validate before calling

let p = std::path::absolute(mountpoint)?;
assert!(p.is_absolute());
assert!(!p.components().any(|c| matches!(c, std::path::Component::ParentDir)));
assert!(p.parent().is_some());

Prevention

When it happens

Trigger: Calling validate_launch with a lease/service mountpoint that is relative, contains a ".." component, or has no parent (e.g. "/").

Common situations: Configuration substituting a relative path or environment-variable placeholder that expands with ".."; programmatic path joining producing "a/../b" style paths; passing the filesystem root; typos like a leading missing slash in config files.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/135fd09d960e2fd6. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-storage-provider-fuse/src/service.rs:250

    if manifest.len() > 64 * 1024 {
        bail!("FUSE lease manifest exceeds the bounded size");
    }
    let admitted: StorageMountLeaseV1 =
        serde_json::from_slice(&manifest).context("decode FUSE lease manifest")?;
    if admitted != *lease {
        bail!("FUSE launch lease does not match the kernel manifest");
    }
    Ok(())
}

fn validate_mountpoint(mountpoint: &Path, resource_path: &Path) -> Result<()> {
    if !mountpoint.is_absolute()
        || mountpoint
            .components()
            .any(|component| matches!(component, std::path::Component::ParentDir))
        || mountpoint.parent().is_none()
    {
        bail!("FUSE service mountpoint is malformed");
    }
    if mountpoint == resource_path
        || mountpoint.starts_with(resource_path)
        || resource_path.starts_with(mountpoint)
    {
        bail!("FUSE service mountpoint overlaps the lease resource");
    }
    platform_fs::validate_private_directory(mountpoint)
        .context("validate private FUSE service mountpoint")?;
    platform_fs::verify_no_redirects(mountpoint)
        .context("reject redirected FUSE service mountpoint")?;
    if std::fs::read_dir(mountpoint)?.next().is_some() {
        bail!("FUSE service mountpoint is not empty");
    }
    if mountpoint::mountinfo_contains(mountpoint)? {
        bail!("FUSE service mountpoint is already mounted");
    }
    Ok(())

View on GitHub (pinned to affd8760f4)