astrid-runtime/astrid · error

FSKit service launch exceeds limit

Error message

FSKit service launch exceeds limit

What it means

read_launch reads the JSON launch payload from stdin but caps it at MAX_LAUNCH_BYTES by reading one extra byte; if more than MAX_LAUNCH_BYTES bytes arrive it bails instead of decoding. This protects the privileged service from unbounded or hostile stdin payloads.

Source

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

            return match result {
                Ok(()) => Err(unmount_error),
                Err(primary) => Err(primary.context(unmount_error)),
            };
        }
    }
    let _ = local_transport::remove_endpoint(&launch.control_path);
    result
}

fn read_launch() -> Result<StorageProviderServiceLaunchV1> {
    let mut bytes = Vec::new();
    std::io::stdin()
        .lock()
        .take(MAX_LAUNCH_BYTES + 1)
        .read_to_end(&mut bytes)
        .context("read FSKit service launch")?;
    if bytes.len() as u64 > MAX_LAUNCH_BYTES {
        bail!("FSKit service launch exceeds limit");
    }
    serde_json::from_slice(&bytes).context("decode FSKit service launch")
}

fn validate_launch(launch: &StorageProviderServiceLaunchV1) -> Result<()> {
    if launch.schema != STORAGE_FILESYSTEM_SERVICE_LAUNCH_SCHEMA_V1 {
        bail!("unsupported FSKit service launch schema {}", launch.schema);
    }
    validate_launch_parent(&launch.parent)?;
    validate_lease(&launch.lease)?;
    crate::validate_mountpoint_layout(&launch.mountpoint)?;
    if launch.mountpoint == launch.lease.resource_path
        || launch.mountpoint.starts_with(&launch.lease.resource_path)
        || launch.lease.resource_path.starts_with(&launch.mountpoint)
    {
        bail!("FSKit service mountpoint overlaps the lease resource");
    }
    crate::validate_mountpoint_ancestors(&launch.mountpoint)?;

View on GitHub (pinned to affd8760f4)

Solutions

  1. Reduce the launch payload below MAX_LAUNCH_BYTES (shorten paths, move large data to files referenced by path)
  2. Check the parent version against the service version and upgrade so both agree on payload size limits
  3. Inspect what the parent actually writes to stdin (log the byte count) and fix the oversized field

Example fix

// before
launch.note = huge_debug_blob; // inflates JSON past MAX_LAUNCH_BYTES
// after
launch.note = "diagnostics written to /tmp/launch-notes.txt";
Defensive patterns

Strategy: validation

Validate before calling

let payload = serde_json::to_vec(&launch)?;
anyhow::ensure!(
    (payload.len() as u64) <= MAX_LAUNCH_BYTES,
    "launch payload {} bytes exceeds limit {}",
    payload.len(),
    MAX_LAUNCH_BYTES
);

Prevention

When it happens

Trigger: The parent writes a launch payload larger than MAX_LAUNCH_BYTES (e.g. huge resource/callback paths or embedded data) to the service's stdin; a broken/buggy parent streams garbage or an oversized document.

Common situations: Embedding very long paths, tokens, or blobs inside the launch JSON; a corrupted pipe delivering leftover data; older parent version writing an extended schema with extra fields.

Understand the failure class

Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.

Related errors


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