{"record":{"id":"81337faaf6f5e4d0","repo":"zeroclaw-labs/zeroclaw","slug":"failed-to-copy-bridge-app","errorCode":null,"errorMessage":"Failed to copy Bridge app","messagePattern":"Failed to copy Bridge app","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-hardware/src/peripherals/uno_q_setup.rs","lineNumber":56,"sourceCode":"    let status = Command::new(\"ssh\")\n        .args([\"--\", &ssh_target, \"mkdir\", \"-p\", \"~/ArduinoApps\"])\n        .status()\n        .context(\"ssh mkdir failed\")?;\n    if !status.success() {\n        anyhow::bail!(\"Failed to create ArduinoApps dir on Uno Q\");\n    }\n\n    let status = Command::new(\"scp\")\n        .args([\n            \"-r\",\n            \"--\",\n            bridge_dir.to_str().unwrap(),\n            &format!(\"{}:~/ArduinoApps/\", ssh_target),\n        ])\n        .status()\n        .context(\"scp failed\")?;\n    if !status.success() {\n        anyhow::bail!(\"Failed to copy Bridge app\");\n    }\n\n    println!(\"Starting Bridge app on Uno Q...\");\n    let status = Command::new(\"ssh\")\n        .args([\n            \"--\",\n            &ssh_target,\n            \"arduino-app-cli\",\n            \"app\",\n            \"start\",\n            \"~/ArduinoApps/uno-q-bridge\",\n        ])\n        .status()\n        .context(\"arduino-app-cli start failed\")?;\n    if !status.success() {\n        anyhow::bail!(\"Failed to start Bridge app. Ensure arduino-app-cli is installed on Uno Q.\");\n    }\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-hardware/src/peripherals/uno_q_setup.rs#L38-L74","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the board: `ssh arduino@<host> 'df -h ~ && ls -la ~/ArduinoApps'`","Clean the previous copy: `ssh arduino@<host> 'rm -rf ~/ArduinoApps/uno-q-bridge'` and rerun the setup","If transfers keep dying mid-way, check the network link to the board and retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"let df = std::process::Command::new(\"ssh\")\n    .args([\"--\", &format!(\"arduino@{host}\"), \"df\", \"-Pk\", \"~/ArduinoApps\"])\n    .output()?;\n// fail early if the board's home filesystem is full\nlet text = String::from_utf8_lossy(&df.stdout);\nif !text.contains('/') { anyhow::bail!(\"cannot stat ~/ArduinoApps on board\"); }","typeGuard":null,"tryCatchPattern":"match setup_uno_q_bridge(Some(host)) {\n    Err(e) if format!(\"{e}\").contains(\"Failed to copy Bridge app\") => {\n        // clean ~/ArduinoApps/uno-q-bridge on the board, free disk, retry once\n    }\n    rest => rest,\n}","preventionTips":["Clean previous deploys from ~/ArduinoApps before re-running setup","Keep free space on the board's home filesystem","Prefer wired/stable network links for scp of the whole app directory"],"tags":["scp","uno-q","file-transfer","remote-deploy","disk-full"],"backgroundTag":"scp-transfer-failed","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}