spacedriveapp/spacedrive · error · anyhow::Error
Pull request rejected: {}
Error message
Pull request rejected: {} What it means
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.
Source
Thrown at core/src/ops/files/copy/strategy.rs:568
let file_metadata = match response {
crate::service::network::protocol::file_transfer::FileTransferMessage::PullResponse {
accepted: true,
file_metadata: Some(metadata),
..
} => {
ctx.log(format!(
"PullRequest accepted: {} bytes",
metadata.size
));
metadata
}
crate::service::network::protocol::file_transfer::FileTransferMessage::PullResponse {
accepted: false,
error,
..
} => {
let err_msg = error.unwrap_or_else(|| "Unknown error".to_string());
return Err(anyhow::anyhow!("Pull request rejected: {}", err_msg));
}
_ => {
return Err(anyhow::anyhow!(
"Unexpected response to pull request"
));
}
};
let file_size = file_metadata.size;
// Ensure parent directory exists
if let Some(parent) = local_dest_path.parent() {
fs::create_dir_all(parent).await?;
}
// Determine final file path
let final_dest_path =
if local_dest_path.is_dir() || local_dest_path.to_string_lossy().ends_with('/') {View on GitHub (pinned to 6dfeccf211)
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
Defensive patterns
Strategy: try-catch
Try / catch
match remote_strategy.execute_pull(ctx, &src, &dst).await {
Ok(n) => Ok(n),
Err(e) if e.to_string().starts_with("Pull request rejected") => {
// e carries the REMOTE's reason; surface it to the user and refresh the index
refresh_library_index(ctx.library()).await;
Err(anyhow::anyhow!("remote refused the pull: {}", e))
}
Err(e) => Err(e),
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Source must be a physical path for PULL operation
- Destination must be local path for PULL operation
- Could not resolve source device slug '{}' to UUID in library
- Failed to connect to device: {}
- Failed to open bidirectional stream: {}
AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16).
Data as JSON: /api/errors/eff1ded34d94dc9e.
Report an issue: GitHub.