spacedriveapp/spacedrive · error · anyhow::Error
Transfer error: {}
Error message
Transfer error: {} What it means
Thrown during a PULL-mode cross-device file copy when the remote sender transmits a FileTransferMessage::TransferError frame. The failure originated on the peer, not locally: the embedded message names what went wrong on the sender side (read failure, verification failure, internal abort). Before returning, the receiver deletes the partially downloaded file at final_dest_path, so no partial artifact remains.
Source
Thrown at core/src/ops/files/copy/strategy.rs:729
return Err(anyhow::anyhow!("Final checksum mismatch"));
}
}
}
transfer_completed = true;
ctx.log(format!(
"PULL transfer completed: {} bytes received",
total_bytes_received
));
break;
}
crate::service::network::protocol::file_transfer::FileTransferMessage::TransferError {
message,
..
} => {
// Clean up partial file
let _ = fs::remove_file(&final_dest_path).await;
return Err(anyhow::anyhow!("Transfer error: {}", message));
}
_ => {
debug!("Received unexpected message during PULL transfer");
}
}
}
// Verify transfer completed properly
if !transfer_completed {
let _ = fs::remove_file(&final_dest_path).await;
return Err(anyhow::anyhow!(
"Transfer interrupted: received {} of {} bytes before connection closed",
total_bytes_received,
file_size
));
}
file.flush().await?;View on GitHub (pinned to 6dfeccf211)
Solutions
- Read the embedded remote message - it states the actual root cause on the sending device
- Verify the source file still exists and is readable by the daemon on the remote device
- Check sender-side daemon logs around the failure time for the paired error
- Confirm both devices run the same sd-core version, then retry the copy job
Defensive patterns
Strategy: try-catch
Try / catch
match run_copy().await {
Ok(out) => out,
Err(ref e) if e.to_string().starts_with("Transfer error:") => {
// Peer-reported failure; the partial file was already cleaned up locally.
// Surface the peer message instead of retrying blindly.
return Err(anyhow::anyhow!("Remote device failed the transfer: {}", e));
}
Err(e) => return Err(e),
} Prevention
- Keep source files unchanged while a copy job targeting them is queued
- Run matching sd-core versions on all paired devices
- Exclude library roots from antivirus real-time scanning
When it happens
Trigger: Running a copy job that pulls a file from another device; the sender emits TransferError { message, .. } mid-stream and the match arm at strategy.rs:729 fires. Happens when the source file becomes unreadable on the sender, sender-side verification fails, or the sender aborts the session.
Common situations: Source file moved, deleted, or locked (antivirus scan, Windows file lock) on the sender between job creation and transfer; sender disk full or permissions revoked mid-read; sender running a protocol version that aborts on the first chunk.
Related errors
- Transfer interrupted: received {} of {} bytes before connect
- Could not find node_id for device {}
- Failed to open stream: {}
- Failed to write message length: {}
- Failed to write chunk data: {}
AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16).
Data as JSON: /api/errors/2dda1b3da3aa01dc.
Report an issue: GitHub.