{"record":{"id":"bdbed639a8d22262","repo":"spacedriveapp/spacedrive","slug":"could-not-find-node-id-for-device-slug-d","errorCode":null,"errorMessage":"Could not find node_id for device {} (slug: {}). Device may be offline.","messagePattern":"Could not find node_id for device (.+?) \\(slug: (.+?)\\)\\. Device may be offline\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"core/src/ops/files/copy/strategy.rs","lineNumber":476,"sourceCode":"\t\t\t\"Initiating PULL transfer: device:{}:{} -> {}\",\n\t\t\tsource_device_slug,\n\t\t\tsource_path.display(),\n\t\t\tlocal_dest_path.display()\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 networking_guard = &*networking;\n\n\t\t// Resolve device slug to node_id for network routing\n\t\tlet device_registry = networking_guard.device_registry();\n\t\tlet registry = device_registry.read().await;\n\t\tlet node_id = registry\n\t\t\t.get_node_by_device(source_device_id)\n\t\t\t.ok_or_else(|| {\n\t\t\t\tanyhow::anyhow!(\n\t\t\t\t\t\"Could not find node_id for device {} (slug: {}). Device may be offline.\",\n\t\t\t\t\tsource_device_id,\n\t\t\t\t\tsource_device_slug\n\t\t\t\t)\n\t\t\t})?;\n\t\tdrop(registry);\n\n\t\tlet endpoint = networking_guard\n\t\t\t.endpoint()\n\t\t\t.ok_or_else(|| anyhow::anyhow!(\"Networking endpoint not available\"))?;\n\n\t\tctx.log(format!(\n\t\t\t\"Opening PULL connection to node {} (device {})\",\n\t\t\tnode_id, source_device_id\n\t\t));\n\n\t\t// Connect to remote device\n\t\tlet node_addr = iroh::EndpointAddr::new(node_id);","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/ops/files/copy/strategy.rs#L458-L494","documentation":"After resolving the source UUID, execute_pull maps it to an iroh EndpointId via DeviceRegistry::get_node_by_device (core/src/service/network/device/registry.rs:626). None means this daemon currently has no known live node for that device — the peer is offline, not yet discovered, or its node entry expired. The message itself hints 'Device may be offline.'","triggerScenarios":"Peer device offline or asleep when the job runs; discovery/pairing incomplete so no node exists for the UUID; node entry evicted after prolonged disconnection; job retried after a network flap before the registry re-registers the node.","commonSituations":"Scheduled sync jobs firing while the peer laptop is closed; devices on separate networks with no relay path; race between pairing completion and node registration.","solutions":["Verify the device is online (network status / device list query) and re-run the copy","Ensure discovery and pairing completed so the device registry holds a node for the UUID","Retry with backoff — the registry repopulates as soon as the peer reconnects","Check relay/connectivity settings if the peer should currently be reachable"],"exampleFix":"// before\nremote_strategy.execute_pull(ctx, &src, &dst).await?; // \"Could not find node_id ... Device may be offline.\"\n\n// after: bounded wait for the peer to register\nlet networking = ctx.networking_service().ok_or_else(|| anyhow::anyhow!(\"no networking\"))?;\nlet registry = networking.device_registry();\nfor attempt in 0..5 {\n    if registry.read().await.get_node_by_device(device_id).is_some() {\n        break;\n    }\n    tokio::time::sleep(std::time::Duration::from_secs(1u64 << attempt)).await;\n}\nremote_strategy.execute_pull(ctx, &src, &dst).await?;","handlingStrategy":"retry","validationCode":"let networking = ctx.networking_service().ok_or_else(|| anyhow::anyhow!(\"no networking\"))?;\nlet registry = networking.device_registry();\nif registry.read().await.get_node_by_device(device_id).is_none() {\n    return Err(anyhow::anyhow!(\"device {} has no live node; likely offline — retry when online\", device_id));\n}","typeGuard":null,"tryCatchPattern":"match remote_strategy.execute_pull(ctx, &src, &dst).await {\n    Ok(n) => Ok(n),\n    Err(e) if e.to_string().contains(\"Device may be offline\") => {\n        schedule_retry_with_backoff(job_id, 5).await;\n        Err(e)\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Check the device registry for a live node before starting a PULL","Treat 'may be offline' as retryable and back off until the peer reconnects","Keep peers awake/online for the duration of scheduled sync jobs"],"tags":["rust","spacedrive","pull","device-registry","offline","iroh","networking"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}