AprilNEA/OpenLogi · error

the running Agent timed out while providing its device…

Error message

the running Agent timed out while providing its device snapshot

What it means

After client declaration, `capture_connected_profile` fetches the agent's device snapshot with a `SNAPSHOT_TIMEOUT`. The outer `Err` of `tokio::time::timeout` — no response in time — raises this error, indicating the agent accepted the request but could not deliver its snapshot promptly.

Solutions

  1. Retry the command; transient slowness often resolves
  2. Reduce concurrent agent load (close other CLI hardware sessions) and retry
  3. Restart the agent if it remains unresponsive
  4. If it recurs, profile the agent's snapshot/enumeration path for blocking I/O
Defensive patterns

Strategy: retry

Validate before calling

// ensure a fresh snapshot is cheap before capture
match tokio::time::timeout(Duration::from_secs(3), connect_and_snapshot_probe()).await {
    Ok(Ok(_)) => println!("snapshot path healthy"),
    _ => eprintln!("agent snapshot slow or broken; restart the agent"),
}

Try / catch

for attempt in 0..2 {
    match capture_connected_profile(&conn, ...).await {
        Err(e) if e.to_string().contains("timed out while providing its device snapshot") && attempt == 0 => continue,
        other => break other,
    }
}

Prevention

When it happens

Trigger: `connection.client.snapshot(...)` does not complete within `SNAPSHOT_TIMEOUT` — the agent is busy enumerating HID devices, blocked on slow hardware, or its event loop is stalled after successful `declare_client`.

Common situations: Large inventory with slow/unresponsive devices, receiver rescans taking too long, agent doing a firmware/DPI operation concurrently, system under heavy load or just resumed from sleep.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of AprilNEA/OpenLogi@e846e6f4b4 (2026-09-13). Data as JSON: /api/errors/95900addc5ad1b11. Report an issue: GitHub.

Appendix: source

Thrown at crates/openlogi-cli/src/cmd/fixture/record_profile.rs:150

        );
    }

    tokio::time::timeout(
        DECLARE_TIMEOUT,
        connection
            .client
            .declare_client(context::current(), ClientKind::Cli),
    )
    .await
    .map_err(|_| anyhow!("the running Agent timed out before semantic capture could begin"))?
    .map_err(|_| anyhow!("the running Agent disconnected before semantic capture could begin"))?;

    let snapshot = tokio::time::timeout(
        SNAPSHOT_TIMEOUT,
        connection.client.snapshot(context::current()),
    )
    .await
    .map_err(|_| anyhow!("the running Agent timed out while providing its device snapshot"))?
    .map_err(|_| anyhow!("the running Agent disconnected while providing its device snapshot"))?;

    let captured = capture_profile(&connection.client, snapshot, selector, id, name).await?;
    captured
        .profile
        .validate()
        .context("captured semantic profile failed version-1 validation; no profile was written")?;
    Ok(captured)
}

fn validate_metadata(args: &RecordProfileArgs) -> Result<()> {
    if args.id.trim().is_empty() {
        bail!("--id must be a nonempty synthetic identifier");
    }
    if args.name.trim().is_empty() {
        bail!("--name must be a nonempty synthetic profile name");
    }
    Ok(())

View on GitHub (pinned to e846e6f4b4)