spacedriveapp/spacedrive · error · anyhow::Error

Could not resolve source device slug '{}' to UUID in library

Error message

Could not resolve source device slug '{}' to UUID in library {}. Device may not be registered in this library.

What it means

Mirror of the PUSH-side failure: execute_pull resolves the source's device slug through Library::resolve_device_slug (core/src/library/mod.rs:333) and gets None, so the slug is unknown in this library. Without the UUID the transfer cannot proceed to the device registry lookup or network routing.

Source

Thrown at core/src/ops/files/copy/strategy.rs:437

		&self,
		ctx: &JobContext<'a>,
		source: &SdPath,
		destination: &SdPath,
		verify_checksum: bool,
		progress_callback: Option<&ProgressCallback<'a>>,
	) -> Result<u64> {
		let (source_device_slug, source_path) = source
			.as_physical()
			.ok_or_else(|| anyhow::anyhow!("Source must be a physical path for PULL operation"))?;

		let local_dest_path = destination
			.as_local_path()
			.ok_or_else(|| anyhow::anyhow!("Destination must be local path for PULL operation"))?;

		let library = ctx.library();
		let source_device_id = library
			.resolve_device_slug(source_device_slug)
			.ok_or_else(|| anyhow::anyhow!(
				"Could not resolve source device slug '{}' to UUID in library {}. Device may not be registered in this library.",
				source_device_slug,
				library.id()
			))?;

		debug!(
			"RemoteTransferStrategy PULL: device:{} ({}) -> {}",
			source_device_slug,
			source_device_id,
			local_dest_path.display()
		);

		info!(
			"Initiating PULL transfer: device:{}:{} -> {}",
			source_device_slug,
			source_path.display(),
			local_dest_path.display()
		);

View on GitHub (pinned to 6dfeccf211)

Solutions

  1. Confirm the source device is paired with and synced in this library, then retry
  2. Verify the slug against the library's device list and correct the source SdPath
  3. Re-pair the device if it re-registered with a new identity
  4. Wait for library/device sync to complete before dispatching the pull job

Example fix

// before
let src = SdPath::physical("old-phone", PathBuf::from("DCIM/1.jpg"));
remote_strategy.execute_pull(ctx, &src, &dest).await?; // "Could not resolve source device slug ..."

// after
let slug = "old-phone";
let Some(device_id) = ctx.library().resolve_device_slug(slug) else {
    return Err(anyhow::anyhow!("device '{}' not registered in library {}", slug, ctx.library().id()));
};
tracing::debug!(%device_id, "source device resolved");
remote_strategy.execute_pull(ctx, &src, &dest).await?;
Defensive patterns

Strategy: validation

Validate before calling

let (slug, _) = source.as_physical().ok_or_else(|| anyhow::anyhow!("source not physical"))?;
ctx.library().resolve_device_slug(slug).ok_or_else(|| {
    anyhow::anyhow!("device '{}' not registered in library {}; pair it first", slug, ctx.library().id())
})?;

Prevention

When it happens

Trigger: PULL from a device slug with no row in this library's device table: unpaired peer, slug from another library, stale slug after the peer re-registered its identity, or device rows not yet replicated to this library's DB.

Common situations: Copying from a newly added device before its registration syncs; peer re-installed Spacedrive and generated a new identity; confusion between multiple libraries sharing device names.

Related errors


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