astrid-runtime/astrid · error

FSKit callback path is not the kernel lease endpoint

Error message

FSKit callback path is not the kernel lease endpoint

What it means

On non-macOS platforms, validate_lease requires lease.callback_path to equal resource_path.join("control.sock") — the fixed kernel lease endpoint layout. Any other callback location is rejected. (On macOS the astrid_core::fskit_socket::validate_callback_path check applies instead.)

Source

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

    if lease.lease_token.len() < 16 || lease.lease_token.len() > 4096 {
        bail!("FSKit lease callback token is invalid");
    }
    let now = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .context("read system clock")?
        .as_secs();
    if lease.expires_at_epoch_secs < now {
        bail!("FSKit lease is expired");
    }
    if !lease.resource_path.is_absolute() || !lease.callback_path.is_absolute() {
        bail!("FSKit lease paths must be absolute");
    }
    #[cfg(target_os = "macos")]
    astrid_core::fskit_socket::validate_callback_path(lease.mount_id, &lease.callback_path)
        .map_err(anyhow::Error::msg)?;
    #[cfg(not(target_os = "macos"))]
    if lease.callback_path != lease.resource_path.join("control.sock") {
        bail!("FSKit callback path is not the kernel lease endpoint");
    }
    platform_fs::validate_private_directory(&lease.resource_path)
        .context("validate private FSKit lease resource")?;
    platform_fs::verify_no_redirects(&lease.resource_path)
        .context("reject redirected FSKit lease resource")?;
    platform_fs::validate_private_file(&lease.resource_path.join("lease.json"))
        .context("validate private FSKit lease manifest")?;
    let manifest = std::fs::read(lease.resource_path.join("lease.json"))
        .context("read FSKit lease manifest")?;
    if manifest.len() > 64 * 1024 {
        bail!("FSKit lease manifest exceeds the bounded size");
    }
    let admitted: astrid_core::storage_filesystem::StorageMountLeaseV1 =
        serde_json::from_slice(&manifest).context("decode FSKit lease manifest")?;
    if admitted != *lease {
        bail!("FSKit launch lease does not match the kernel manifest");
    }
    Ok(())

View on GitHub (pinned to affd8760f4)

Solutions

  1. Set callback_path to resource_path.join("control.sock") in the lease
  2. Regenerate the lease with the provider so the endpoint layout matches
  3. On macOS, ensure the callback path satisfies fskit_socket::validate_callback_path for the mount_id

Example fix

// before
callback_path: "/tmp/control.sock".into()
// after
callback_path: lease.resource_path.join("control.sock")
Defensive patterns

Strategy: validation

Validate before calling

fn callback_ok(lease: &StorageMountLeaseV1) -> bool {
    #[cfg(target_os = "macos")]
    { let _ = lease; true /* validated by fskit_socket */ }
    #[cfg(not(target_os = "macos"))]
    lease.callback_path == lease.resource_path.join("control.sock")
}

Prevention

When it happens

Trigger: validate_lease (via validate_launch or live_managed_callback_lease_is_accepted) on Linux/other with callback_path != resource_path/control.sock, e.g. a custom socket name or a callback path in another directory.

Common situations: Hand-edited lease JSON pointing callback_path elsewhere; tooling that moves the socket to a tmp directory; leases generated by a different version with a different endpoint convention.

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/9b49bab5accc21c9. Report an issue: GitHub.