astrid-runtime/astrid · error
provider request exceeds limit
Error message
provider request exceeds limit
What it means
run() reads the provider request from stdin, taking MAX_REQUEST_BYTES + 1 bytes so oversized payloads are detectable. If the byte length exceeds MAX_REQUEST_BYTES the request is rejected rather than parsed, protecting the companion from unbounded memory use.
Source
Thrown at crates/astrid-storage-provider-fskit/src/main.rs:87
eprintln!("{PROVIDER_NAME}: {error:#}");
std::process::exit(2);
},
}
}
async fn run() -> Result<StorageProviderResponseV1> {
let arguments = std::env::args_os().skip(1).collect::<Vec<_>>();
if arguments.as_slice() != [std::ffi::OsStr::new("--astrid-provider-stdio-v1")] {
bail!("this executable is an Astrid provider companion, not an interactive command");
}
let mut bytes = Vec::new();
std::io::stdin()
.lock()
.take(MAX_REQUEST_BYTES + 1)
.read_to_end(&mut bytes)
.context("read provider request")?;
if bytes.len() as u64 > MAX_REQUEST_BYTES {
bail!("provider request exceeds limit");
}
let request: StorageProviderRequestV1 =
serde_json::from_slice(&bytes).context("decode provider request")?;
if request.protocol_version != STORAGE_PROVIDER_PROTOCOL_V1 {
bail!("unsupported provider protocol {}", request.protocol_version);
}
let request_id = request.request_id;
let outcome = match execute(request).await {
Ok(success) => StorageProviderOutcomeV1::Success(success),
Err(error) => StorageProviderOutcomeV1::Failure(provider_failure::provider_failure(&error)),
};
Ok(StorageProviderResponseV1 {
protocol_version: STORAGE_PROVIDER_PROTOCOL_V1,
request_id,
provider: StorageProviderIdentityV1 {
name: PROVIDER_NAME.to_owned(),
version: env!("CARGO_PKG_VERSION").to_owned(),
capabilities: vec![View on GitHub (pinned to affd8760f4)
Solutions
- Reduce the request size (e.g. move large payloads out of the request body)
- Check the client's serialization for accidental inclusion of bulk data
- If legitimately needed, raise MAX_REQUEST_BYTES in the companion source and rebuild both sides
Example fix
// before (client) request.extra_payload = huge_blob; send(serde_json::to_vec(&request)?); // after request.payload_ref = write_to_staging(&huge_blob)?; send(serde_json::to_vec(&request)?);
Defensive patterns
Strategy: validation
Validate before calling
// rust (client side, before writing to the companion's stdin)
let bytes = serde_json::to_vec(&request)?;
anyhow::ensure!(bytes.len() as u64 <= MAX_REQUEST_BYTES, "request is {} bytes, limit is {MAX_REQUEST_BYTES}", bytes.len()); Prevention
- Keep bulk data out of provider requests; pass references/paths instead
- Check serialized size before sending
- Keep kernel and companion request schemas in sync
When it happens
Trigger: The kernel (or any client) writes a serialized StorageProviderRequestV1 larger than MAX_REQUEST_BYTES to the companion's stdin.
Common situations: A mount request embedding an unusually large payload/manifest; a buggy client streaming an endless request without framing; protocol misuse where bulk data is sent over the control channel instead of the mounted filesystem.
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
- daemon closed guard uplink
- guard uplink authenticated as anonymous instead of requested
- unexpected response shape: {other:?}
- unexpected response from kernel: {other:?}
- unexpected daemon metadata response: {other:?}
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/26ec86f19fba16ae.
Report an issue: GitHub.