{"record":{"id":"eff1ded34d94dc9e","repo":"spacedriveapp/spacedrive","slug":"pull-request-rejected","errorCode":null,"errorMessage":"Pull request rejected: {}","messagePattern":"Pull request rejected: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"core/src/ops/files/copy/strategy.rs","lineNumber":568,"sourceCode":"\t\tlet file_metadata = match response {\n\t\t\tcrate::service::network::protocol::file_transfer::FileTransferMessage::PullResponse {\n\t\t\t\taccepted: true,\n\t\t\t\tfile_metadata: Some(metadata),\n\t\t\t\t..\n\t\t\t} => {\n\t\t\t\tctx.log(format!(\n\t\t\t\t\t\"PullRequest accepted: {} bytes\",\n\t\t\t\t\tmetadata.size\n\t\t\t\t));\n\t\t\t\tmetadata\n\t\t\t}\n\t\t\tcrate::service::network::protocol::file_transfer::FileTransferMessage::PullResponse {\n\t\t\t\taccepted: false,\n\t\t\t\terror,\n\t\t\t\t..\n\t\t\t} => {\n\t\t\t\tlet err_msg = error.unwrap_or_else(|| \"Unknown error\".to_string());\n\t\t\t\treturn Err(anyhow::anyhow!(\"Pull request rejected: {}\", err_msg));\n\t\t\t}\n\t\t\t_ => {\n\t\t\t\treturn Err(anyhow::anyhow!(\n\t\t\t\t\t\"Unexpected response to pull request\"\n\t\t\t\t));\n\t\t\t}\n\t\t};\n\n\t\tlet file_size = file_metadata.size;\n\n\t\t// Ensure parent directory exists\n\t\tif let Some(parent) = local_dest_path.parent() {\n\t\t\tfs::create_dir_all(parent).await?;\n\t\t}\n\n\t\t// Determine final file path\n\t\tlet final_dest_path =\n\t\t\tif local_dest_path.is_dir() || local_dest_path.to_string_lossy().ends_with('/') {","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/ops/files/copy/strategy.rs#L550-L586","documentation":"The remote peer answered the PullRequest with PullResponse { accepted: false, error } (strategy.rs:562-569); the remote's own reason string is appended. Typical remote-side causes: the requested path does not exist on that device, the peer's daemon cannot read it (permissions), the path was rejected by policy, or the requesting device is not trusted for this copy.","triggerScenarios":"Source path stale on the remote (file moved/deleted since the local DB indexed it); path separator mismatch after the cross-platform normalization at strategy.rs:508-511; remote daemon lacks read permission; requested_by device not authorized for trusted copy.","commonSituations":"Pulling device's library DB out of sync with the peer's filesystem; copying Windows-origin paths from a Unix peer or vice versa; source file on an unmounted remote volume.","solutions":["Read the appended remote error text — it states the peer's exact reason","Refresh/reindex the source library so the path matches the peer's current filesystem","Verify the path exists on the remote device and the remote daemon can read it","Confirm the devices are paired/trusted so the copy is permitted"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match remote_strategy.execute_pull(ctx, &src, &dst).await {\n    Ok(n) => Ok(n),\n    Err(e) if e.to_string().starts_with(\"Pull request rejected\") => {\n        // e carries the REMOTE's reason; surface it to the user and refresh the index\n        refresh_library_index(ctx.library()).await;\n        Err(anyhow::anyhow!(\"remote refused the pull: {}\", e))\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Reindex the source library before pulling files that may have moved on the peer","Verify read permissions on the remote daemon for the source path","Keep devices paired/trusted so trusted-copy requests are accepted"],"tags":["rust","spacedrive","pull","remote-rejection","file-transfer","cross-device"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}