herdrdev/herdr · error

remote bridge upload failed: {err}

Error message

remote bridge upload failed: {err}

What it means

After the bridge child exits, if neither the stopping nor client_closed flags are set, the upload copy thread's error is surfaced as 'remote bridge upload failed' with its kind preserved. It represents a failure while copying data from the local stream into the ssh child's stdin (the client-to-remote direction).

Source

Thrown at src/remote/attach.rs:2004

        thread::sleep(BRIDGE_ACCEPT_POLL);
    };
    upload_stop.store(true, Ordering::Release);
    if !child_exited {
        connection_stop.store(true, Ordering::Release);
    }
    let upload_result = upload
        .join()
        .map_err(|_| io::Error::other("remote bridge upload worker panicked"))?;
    let download_result = download
        .join()
        .map_err(|_| io::Error::other("remote bridge download worker panicked"))?;
    let status = status_result?;

    let stopping = bridge_stop.load(Ordering::Acquire);
    let client_closed = client_closed.load(Ordering::Acquire);
    if !stopping && !client_closed {
        upload_result.map_err(|err| {
            io::Error::new(err.kind(), format!("remote bridge upload failed: {err}"))
        })?;
        download_result.map_err(|err| {
            io::Error::new(err.kind(), format!("remote bridge download failed: {err}"))
        })?;
    }

    if status.success() || stopping || client_closed {
        Ok(())
    } else {
        Err(io::Error::new(
            io::ErrorKind::ConnectionAborted,
            format!("ssh bridge exited with {status}"),
        ))
    }
}

#[cfg(unix)]
fn copy_flush<R: io::Read, W: io::Write>(reader: &mut R, writer: &mut W) -> io::Result<u64> {

View on GitHub (pinned to f457cff4f2)

Solutions

  1. Check the paired download error / stderr for the root cause (usually ssh exit or remote crash)
  2. Retry the attach after confirming the remote server is healthy (herdr server status on the remote)
  3. Inspect remote herdr logs for a crash coinciding with the failure
  4. Stabilize the network path (keepalives, VPN) if drops are frequent
Defensive patterns

Strategy: retry

Try / catch

match bridge_session() {
    Err(e) if e.to_string().contains("upload failed") => {
        if remote_healthy(target) { bridge_session() } else { Err(e) }
    }
    r => r,
}

Prevention

When it happens

Trigger: Writing to ssh stdin fails mid-session: the remote side closed the connection, the ssh process died while the upload thread was still pumping, or the local stream produced a read error during the upload copy loop.

Common situations: Remote herdr server crash mid-attach, network drop causing ssh to exit while the pump thread is active, or the client half-closing unexpectedly.

Related errors


AI-assisted analysis of herdrdev/herdr@f457cff4f2 (2026-08-28). Data as JSON: /api/errors/e299a05b02198558. Report an issue: GitHub.