astrid-runtime/astrid · error

invalid FUSE service parent PID

Error message

invalid FUSE service parent PID

What it means

Before launching the FUSE service, the parent lifetime descriptor is validated. The parent PID must be greater than 1 and must not be the helper's own PID; otherwise the liveness/token handshake would be meaningless or self-referential. This error signals a malformed or nonsensical parent PID in the launch configuration.

Source

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

    KernelControlResponse::Failure {
        code: code.to_owned(),
        message: message.chars().take(4096).collect(),
    }
}

fn validate_launch(launch: &StorageProviderServiceLaunchV1) -> Result<()> {
    validate_parent(&launch.parent)?;
    validate_lease(&launch.lease)?;
    validate_mountpoint(&launch.mountpoint, &launch.lease.resource_path)?;
    validate_control_path(&launch.control_path, &launch.lease.resource_path)?;
    Ok(())
}

fn validate_parent(
    parent: &astrid_core::storage_filesystem::StorageProviderParentLifetimeV1,
) -> Result<()> {
    if parent.pid <= 1 || parent.pid == std::process::id() {
        bail!("invalid FUSE service parent PID");
    }
    if parent.token.len() < 16
        || parent.token.len() > 512
        || parent.token.chars().any(char::is_control)
    {
        bail!("invalid FUSE service parent token");
    }
    if let Some(identity) = parent.start_identity.as_deref()
        && (identity.is_empty() || identity.len() > 512 || identity.chars().any(char::is_control))
    {
        bail!("invalid FUSE service parent start identity");
    }
    #[cfg(target_os = "linux")]
    if parent.start_identity.is_none() {
        bail!("FUSE service parent start identity is required on Linux");
    }
    Ok(())
}

View on GitHub (pinned to affd8760f4)

Solutions

  1. Set `parent.pid` to the real PID of the spawning process (`std::process::id()` on the parent side) before launching.
  2. Reject/validate the launch config on the parent side before spawning the helper.
  3. Avoid running the mounting client as PID 1 (or pass a dedicated supervisor's PID) in containers.
  4. Fix serialization so the pid field is always populated when building `StorageProviderParentLifetimeV1`.

Example fix

// before
let parent = StorageProviderParentLifetimeV1 { pid: 0, token, .. };
// after
let parent = StorageProviderParentLifetimeV1 { pid: std::process::id(), token, .. };
Defensive patterns

Strategy: validation

Validate before calling

fn valid_parent_pid(pid: u32) -> bool { pid > 1 && pid != std::process::id() }
if !valid_parent_pid(parent.pid) { return Err("bad parent pid"); }

Type guard

fn has_valid_pid(parent: &StorageProviderParentLifetimeV1) -> bool {
    parent.pid > 1 && parent.pid != std::process::id()
}

Prevention

When it happens

Trigger: `validate_parent` (called from `validate_launch`) sees `parent.pid <= 1` (unset, 0, or PID 1) or `parent.pid == std::process::id()` when constructing the launch payload.

Common situations: Caller forgot to fill in the parent PID field (defaults to 0); a container passed PID 1 of the namespace; a bug where the helper spawned itself as parent; deserialized config with missing pid.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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