spacedriveapp/spacedrive · error · anyhow::Error
Could not resolve destination device slug '{}' to UUID in li
Error message
Could not resolve destination device slug '{}' to UUID in library {}. Device may not be registered in this library. What it means
Thrown by RemoteTransferStrategy::execute_push when the destination SdPath carries a device slug that Library::resolve_device_slug (core/src/library/mod.rs:333) cannot map to a UUID. The library's device table has no entry for that slug, so the job cannot identify which registered device should receive the file. It fails before any network activity begins.
Source
Thrown at core/src/ops/files/copy/strategy.rs:304
}
/// Execute a PUSH operation (local -> remote)
async fn execute_push<'a>(
&self,
ctx: &JobContext<'a>,
source: &SdPath,
destination: &SdPath,
_verify_checksum: bool,
progress_callback: Option<&ProgressCallback<'a>>,
) -> Result<u64> {
let dest_device_slug = destination.device_slug().ok_or_else(|| {
anyhow::anyhow!("Destination must have a device slug for cross-device transfer")
})?;
let library = ctx.library();
let dest_device_id = library
.resolve_device_slug(dest_device_slug)
.ok_or_else(|| anyhow::anyhow!(
"Could not resolve destination device slug '{}' to UUID in library {}. Device may not be registered in this library.",
dest_device_slug,
library.id()
))?;
debug!(
"RemoteTransferStrategy PUSH: {} -> device:{} ({})",
source, dest_device_slug, dest_device_id
);
let networking = ctx
.networking_service()
.ok_or_else(|| anyhow::anyhow!("Networking service not available"))?;
let local_path = source
.as_local_path()
.ok_or_else(|| anyhow::anyhow!("Source must be local path for PUSH operation"))?;
View on GitHub (pinned to 6dfeccf211)
Solutions
- Verify the destination device is paired with and synced in this library, then re-run the copy
- Check the library's device list for the expected slug and fix the destination SdPath if it is wrong
- If the peer re-registered with a new identity, re-pair the device and update the destination slug
- If registration is asynchronous, wait for library sync to finish before dispatching the copy job
Example fix
// before
let dest = SdPath::physical("laptop-b", PathBuf::from("photos/a.jpg")); // slug unknown in this library
copy_job.execute(ctx, &source, &dest).await?; // "Could not resolve destination device slug ..."
// after
let slug = "laptop-b";
if ctx.library().resolve_device_slug(slug).is_none() {
return Err(anyhow::anyhow!("device '{}' is not registered in library {}; pair it first", slug, ctx.library().id()));
}
copy_job.execute(ctx, &source, &dest).await?; Defensive patterns
Strategy: validation
Validate before calling
let slug = dest.device_slug().ok_or_else(|| anyhow::anyhow!("destination lacks device slug"))?;
let device_id = ctx.library().resolve_device_slug(slug).ok_or_else(|| {
anyhow::anyhow!("device '{}' is not registered in library {}; pair it first", slug, ctx.library().id())
})?; Prevention
- Resolve destination device slugs against the library before enqueueing cross-device copy jobs
- Re-pair devices after re-installing Spacedrive so slugs stay resolvable
- Wait for library device sync before dispatching jobs that reference new devices
When it happens
Trigger: Calling a cross-device copy whose destination.device_slug() returns a slug with no row in this library's device table: an unpaired device, a slug belonging to a different library, a stale slug after the peer re-registered, or a library DB whose device rows have not synced yet.
Common situations: Copying to a device that was never paired into this library; peer re-installed Spacedrive and got a new device identity while the destination path still references the old slug; job dispatched before device-registration replication completes.
Related errors
- Source must be local path for PUSH operation
- Could not resolve source device slug '{}' to UUID in library
- Networking service not available
- Source must be a physical path for PULL operation
- Destination must be local path for PULL operation
AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16).
Data as JSON: /api/errors/ae1792f8af26eabd.
Report an issue: GitHub.