zeroclaw-labs/zeroclaw · error

Failed to copy Bridge app

Error message

Failed to copy Bridge app

What it means

After the mkdir step, deploy_remote copies the bridge app with `scp -r -- <bridge_dir> <user@host>:~/ArduinoApps/` and bails when scp exits non-zero. The connection was good enough to attempt the copy, but the transfer itself failed.

Source

Thrown at crates/zeroclaw-hardware/src/peripherals/uno_q_setup.rs:56

    let status = Command::new("ssh")
        .args(["--", &ssh_target, "mkdir", "-p", "~/ArduinoApps"])
        .status()
        .context("ssh mkdir failed")?;
    if !status.success() {
        anyhow::bail!("Failed to create ArduinoApps dir on Uno Q");
    }

    let status = Command::new("scp")
        .args([
            "-r",
            "--",
            bridge_dir.to_str().unwrap(),
            &format!("{}:~/ArduinoApps/", ssh_target),
        ])
        .status()
        .context("scp failed")?;
    if !status.success() {
        anyhow::bail!("Failed to copy Bridge app");
    }

    println!("Starting Bridge app on Uno Q...");
    let status = Command::new("ssh")
        .args([
            "--",
            &ssh_target,
            "arduino-app-cli",
            "app",
            "start",
            "~/ArduinoApps/uno-q-bridge",
        ])
        .status()
        .context("arduino-app-cli start failed")?;
    if !status.success() {
        anyhow::bail!("Failed to start Bridge app. Ensure arduino-app-cli is installed on Uno Q.");
    }

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Inspect the board: `ssh arduino@<host> 'df -h ~ && ls -la ~/ArduinoApps'`
  2. Clean the previous copy: `ssh arduino@<host> 'rm -rf ~/ArduinoApps/uno-q-bridge'` and rerun the setup
  3. If transfers keep dying mid-way, check the network link to the board and retry
Defensive patterns

Strategy: retry

Validate before calling

let df = std::process::Command::new("ssh")
    .args(["--", &format!("arduino@{host}"), "df", "-Pk", "~/ArduinoApps"])
    .output()?;
// fail early if the board's home filesystem is full
let text = String::from_utf8_lossy(&df.stdout);
if !text.contains('/') { anyhow::bail!("cannot stat ~/ArduinoApps on board"); }

Try / catch

match setup_uno_q_bridge(Some(host)) {
    Err(e) if format!("{e}").contains("Failed to copy Bridge app") => {
        // clean ~/ArduinoApps/uno-q-bridge on the board, free disk, retry once
    }
    rest => rest,
}

Prevention

When it happens

Trigger: Disk full under the remote home directory; permission problems inside ~/ArduinoApps (e.g. an earlier root-owned copy); the connection dropping mid-transfer; the remote ArduinoApps directory disappearing between steps.

Common situations: Small onboard filesystems filling up after repeated deploys; a previous failed deploy leaving partial or root-owned files; flaky Wi-Fi links to the board.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/81337faaf6f5e4d0. Report an issue: GitHub.