astrid-runtime/astrid · error

FSKit service parent process is not alive

Error message

FSKit service parent process is not alive

What it means

The FSKit provider service runs as a child launched by a parent (XPC/extension) process; on startup its run loop verifies the parent is still alive via parent_is_alive after deserializing the launch payload. If the parent has already exited (or the recorded pid/ppid is wrong), the service refuses to proceed because it would otherwise serve a control socket nobody legitimately owns.

Source

Thrown at crates/astrid-storage-provider-fskit/src/service.rs:66

///
/// The caller must be the kernel-created broker. Public provider requests use
/// the stdio mode and cannot supply this envelope without a live private lease,
/// callback bearer, and parent lifetime.
pub(crate) async fn run() -> Result<()> {
    let launch = read_launch()?;
    validate_launch(&launch)?;
    let challenge = storage_provider_service_ready_challenge(
        &launch.parent.token,
        STORAGE_FILESYSTEM_SERVICE_READY_SCHEMA_V1,
        crate::PROVIDER_NAME,
        launch.lease.mount_id.as_uuid(),
        &launch.control_path,
        &launch.lease.resource_path,
        &launch.lease.callback_path,
    )
    .map_err(anyhow::Error::msg)?;
    if !parent_is_alive(&launch.parent) {
        bail!("FSKit service parent process is not alive");
    }
    probe_callback(&launch).await?;
    let listener = bind_control(&launch.control_path)?;
    let mut mounted = match crate::native_mount(&launch.lease, &launch.mountpoint).await {
        Ok(()) => true,
        Err(error) => {
            let _ = local_transport::remove_endpoint(&launch.control_path);
            return Err(error);
        },
    };
    if let Err(error) = crate::validate_mounted_mountpoint(&launch.mountpoint) {
        let _ = crate::native_unmount(&launch.mountpoint).await;
        let _ = local_transport::remove_endpoint(&launch.control_path);
        return Err(error);
    }
    let ready = StorageProviderServiceReadyV1 {
        schema: STORAGE_FILESYSTEM_SERVICE_READY_SCHEMA_V1,
        provider: crate::PROVIDER_NAME.to_owned(),

View on GitHub (pinned to affd8760f4)

Solutions

  1. Re-trigger the mount from the parent so a fresh service launch happens with a live parent
  2. Check the parent process (ps -p <pid>) referenced in the launch payload to see why it exited; fix its crash/timeout
  3. Avoid long pauses/crashes of the parent during service startup (e.g. remove debugger hold points)
  4. In tests, ensure the simulated parent stays alive until the service completes startup

Example fix

// before (test)
let launch = build_launch(parent_pid_that_exited);
// after
let parent = spawn_parent_and_wait_alive();
let launch = build_launch(parent.pid());
Defensive patterns

Strategy: try-catch

Validate before calling

fn parent_alive(pid: u32) -> bool {
    std::path::Path::new(&format!("/proc/{pid}")).exists() || {
        // macOS: probe via kill(pid, 0)
        unsafe { libc::kill(pid as i32, 0) == 0 }
    }
}
// assert parent_alive(launch.parent) before spawning the service

Try / catch

if !parent_alive(launch.parent) {
    // parent died before service startup: relaunch via the parent flow
    eprintln!("FSKit service parent not alive; re-launching mount from parent");
}

Prevention

When it happens

Trigger: The parent process crashed or was killed between writing the launch payload and the service's parent_is_alive check; the launch payload's parent identifier is stale or forged; slow startup so the parent times out and exits first.

Common situations: Debugger/breakpoints pausing the parent until it times out; kill/restart of the FSKit extension leaving orphaned service invocations; pid reuse or hand-edited launch payloads in tests.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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