astrid-runtime/astrid · error

FUSE service control path is malformed

Error message

FUSE service control path is malformed

What it means

validate_control_path requires the control path to be absolute and free of ParentDir ("..") components before it is compared against the canonical kernel endpoint location. A relative or traversal-containing control path cannot be trusted to resolve to the intended socket location inside the private directory, so the launch is rejected.

Solutions

  1. Make control_path absolute (e.g. /run/astrid/leases/<id>/process-control.sock) before launch
  2. Build the path with Path::join from the resource_path rather than string concatenation
  3. Normalize the path to remove any ".." components before passing it
  4. Fix the config/env value that introduces relative segments

Example fix

// before
let control_path = "../leases/demo/process-control.sock";

// after
let control_path = resource_path.join("process-control.sock");
Defensive patterns

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: Calling validate_launch with a control_path that is relative or contains a ".." component.

Common situations: Config templates substituting relative paths; building the socket path via string concatenation instead of Path::join; environment expansion introducing ".."; copy-pasting a path from a different working directory context.

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/1ecd056afea3ef9d. Report an issue: GitHub.

Appendix: source

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

        .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(())
}

fn validate_control_path(control_path: &Path, resource_path: &Path) -> Result<()> {
    if !control_path.is_absolute()
        || control_path
            .components()
            .any(|component| matches!(component, std::path::Component::ParentDir))
    {
        bail!("FUSE service control path is malformed");
    }
    if control_path != resource_path.join("process-control.sock") {
        bail!("FUSE service control path is not the kernel endpoint");
    }
    let parent = control_path
        .parent()
        .context("FUSE service control path has no parent")?;
    platform_fs::validate_private_directory(parent)
        .context("validate private FUSE control parent")?;
    platform_fs::verify_no_redirects(control_path)
        .context("reject redirected FUSE control path")?;
    if local_transport::endpoint_is_present(control_path)
        .context("inspect FUSE service control endpoint")?
    {
        bail!("FUSE service control endpoint is already present");
    }
    Ok(())
}

View on GitHub (pinned to affd8760f4)