astrid-runtime/astrid · error

invalid FUSE service parent start identity

Error message

invalid FUSE service parent start identity

What it means

The optional `start_identity` field, when present, must be a non-empty string of at most 512 bytes with no control characters. It identifies the parent's start context; an empty, oversized, or control-character-laden value is rejected by `validate_parent`.

Solutions

  1. Pass `None` instead of an empty string when no start identity applies (except on Linux, where it is required).
  2. Trim and sanitize the identity string before embedding it in the launch descriptor.
  3. Shorten the identity (e.g. hash or UUID) to stay under 512 bytes.
  4. Ensure the identity source (env var, config file) is read without control bytes.

Example fix

// before
start_identity: Some(String::new()),
// after
start_identity: None, // or Some(sanitized_identity) on Linux
Defensive patterns

Strategy: validation

Validate before calling

fn valid_identity(id: &Option<String>) -> bool {
    match id {
        None => true,
        Some(s) => !s.is_empty() && s.len() <= 512 && !s.chars().any(char::is_control),
    }
}

Type guard

fn has_valid_start_identity(parent: &StorageProviderParentLifetimeV1) -> bool {
    parent.start_identity.as_deref().map_or(true, |s| !s.is_empty() && s.len() <= 512 && !s.chars().any(char::is_control))
}

Prevention

When it happens

Trigger: `validate_parent` sees `parent.start_identity` as Some but with `is_empty() || len > 512 || control chars` during `validate_launch`.

Common situations: Caller passed `Some(String::new())` to satisfy a type but had no real identity; identity copied from an env var containing a trailing newline; an oversized session/user identity blob exceeding 512 bytes.

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/30b16277fd4966c7. Report an issue: GitHub.

Appendix: source

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

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

fn validate_lease(lease: &StorageMountLeaseV1) -> Result<()> {
    if lease.lease_token.len() < 16
        || lease.lease_token.len() > 4096
        || lease.lease_token.chars().any(char::is_control)
    {
        bail!("invalid FUSE callback token");
    }
    let now = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .context("read system clock")?

View on GitHub (pinned to affd8760f4)