{"record":{"id":"ae1792f8af26eabd","repo":"spacedriveapp/spacedrive","slug":"could-not-resolve-destination-device-slug-to","errorCode":null,"errorMessage":"Could not resolve destination device slug '{}' to UUID in library {}. Device may not be registered in this library.","messagePattern":"Could not resolve destination device slug '(.+?)' to UUID in library (.+?)\\. Device may not be registered in this library\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"core/src/ops/files/copy/strategy.rs","lineNumber":304,"sourceCode":"\t}\n\n\t/// Execute a PUSH operation (local -> remote)\n\tasync fn execute_push<'a>(\n\t\t&self,\n\t\tctx: &JobContext<'a>,\n\t\tsource: &SdPath,\n\t\tdestination: &SdPath,\n\t\t_verify_checksum: bool,\n\t\tprogress_callback: Option<&ProgressCallback<'a>>,\n\t) -> Result<u64> {\n\t\tlet dest_device_slug = destination.device_slug().ok_or_else(|| {\n\t\t\tanyhow::anyhow!(\"Destination must have a device slug for cross-device transfer\")\n\t\t})?;\n\n\t\tlet library = ctx.library();\n\t\tlet dest_device_id = library\n\t\t\t.resolve_device_slug(dest_device_slug)\n\t\t\t.ok_or_else(|| anyhow::anyhow!(\n\t\t\t\t\"Could not resolve destination device slug '{}' to UUID in library {}. Device may not be registered in this library.\",\n\t\t\t\tdest_device_slug,\n\t\t\t\tlibrary.id()\n\t\t\t))?;\n\n\t\tdebug!(\n\t\t\t\"RemoteTransferStrategy PUSH: {} -> device:{} ({})\",\n\t\t\tsource, dest_device_slug, dest_device_id\n\t\t);\n\n\t\tlet networking = ctx\n\t\t\t.networking_service()\n\t\t\t.ok_or_else(|| anyhow::anyhow!(\"Networking service not available\"))?;\n\n\t\tlet local_path = source\n\t\t\t.as_local_path()\n\t\t\t.ok_or_else(|| anyhow::anyhow!(\"Source must be local path for PUSH operation\"))?;\n","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/ops/files/copy/strategy.rs#L286-L322","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nlet dest = SdPath::physical(\"laptop-b\", PathBuf::from(\"photos/a.jpg\")); // slug unknown in this library\ncopy_job.execute(ctx, &source, &dest).await?; // \"Could not resolve destination device slug ...\"\n\n// after\nlet slug = \"laptop-b\";\nif ctx.library().resolve_device_slug(slug).is_none() {\n    return Err(anyhow::anyhow!(\"device '{}' is not registered in library {}; pair it first\", slug, ctx.library().id()));\n}\ncopy_job.execute(ctx, &source, &dest).await?;","handlingStrategy":"validation","validationCode":"let slug = dest.device_slug().ok_or_else(|| anyhow::anyhow!(\"destination lacks device slug\"))?;\nlet device_id = ctx.library().resolve_device_slug(slug).ok_or_else(|| {\n    anyhow::anyhow!(\"device '{}' is not registered in library {}; pair it first\", slug, ctx.library().id())\n})?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["rust","spacedrive","push","device-registry","cross-device","copy"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}