{"record":{"id":"2dda1b3da3aa01dc","repo":"spacedriveapp/spacedrive","slug":"transfer-error","errorCode":null,"errorMessage":"Transfer error: {}","messagePattern":"Transfer error: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"core/src/ops/files/copy/strategy.rs","lineNumber":729,"sourceCode":"\t\t\t\t\t\t\t\treturn Err(anyhow::anyhow!(\"Final checksum mismatch\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttransfer_completed = true;\n\t\t\t\t\tctx.log(format!(\n\t\t\t\t\t\t\"PULL transfer completed: {} bytes received\",\n\t\t\t\t\t\ttotal_bytes_received\n\t\t\t\t\t));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcrate::service::network::protocol::file_transfer::FileTransferMessage::TransferError {\n\t\t\t\t\tmessage,\n\t\t\t\t\t..\n\t\t\t\t} => {\n\t\t\t\t\t// Clean up partial file\n\t\t\t\t\tlet _ = fs::remove_file(&final_dest_path).await;\n\t\t\t\t\treturn Err(anyhow::anyhow!(\"Transfer error: {}\", message));\n\t\t\t\t}\n\t\t\t\t_ => {\n\t\t\t\t\tdebug!(\"Received unexpected message during PULL transfer\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify transfer completed properly\n\t\tif !transfer_completed {\n\t\t\tlet _ = fs::remove_file(&final_dest_path).await;\n\t\t\treturn Err(anyhow::anyhow!(\n\t\t\t\t\"Transfer interrupted: received {} of {} bytes before connection closed\",\n\t\t\t\ttotal_bytes_received,\n\t\t\t\tfile_size\n\t\t\t));\n\t\t}\n\n\t\tfile.flush().await?;","sourceCodeStart":711,"sourceCodeEnd":747,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/ops/files/copy/strategy.rs#L711-L747","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match run_copy().await {\n    Ok(out) => out,\n    Err(ref e) if e.to_string().starts_with(\"Transfer error:\") => {\n        // Peer-reported failure; the partial file was already cleaned up locally.\n        // Surface the peer message instead of retrying blindly.\n        return Err(anyhow::anyhow!(\"Remote device failed the transfer: {}\", e));\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["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"],"tags":["network","file-transfer","p2p","copy"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}