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

  1. Read the appended remote error text — it states the peer's exact reason
  2. Refresh/reindex the source library so the path matches the peer's current filesystem
  3. Verify the path exists on the remote device and the remote daemon can read it
  4. 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

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


AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16). Data as JSON: /api/errors/eff1ded34d94dc9e. Report an issue: GitHub.