{"record":{"id":"73f03cc54dc672d2","repo":"spacedriveapp/spacedrive","slug":"could-not-find-node-id-for-device","errorCode":null,"errorMessage":"Could not find node_id for device {}","messagePattern":"Could not find node_id for device (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"core/src/ops/files/copy/strategy.rs","lineNumber":1116,"sourceCode":"\n\tdebug!(\n\t\t\"Streaming {} bytes to device {}\",\n\t\ttotal_size, destination_device_id\n\t);\n\n\tlet networking = ctx\n\t\t.networking_service()\n\t\t.ok_or_else(|| anyhow::anyhow!(\"Networking service not available\"))?;\n\n\tlet networking_guard = &*networking;\n\n\t// Map device UUID to Iroh node_id for network routing.\n\tlet device_registry = networking_guard.device_registry();\n\tlet registry = device_registry.read().await;\n\tlet node_id = registry\n\t\t.get_node_by_device(destination_device_id)\n\t\t.ok_or_else(|| {\n\t\t\tanyhow::anyhow!(\n\t\t\t\t\"Could not find node_id for device {}\",\n\t\t\t\tdestination_device_id\n\t\t\t)\n\t\t})?;\n\tdrop(registry);\n\n\tlet endpoint = networking_guard\n\t\t.endpoint()\n\t\t.ok_or_else(|| anyhow::anyhow!(\"Networking endpoint not available\"))?;\n\n\tctx.log(format!(\n\t\t\"Opening persistent connection to node {} (device {}) for file transfer\",\n\t\tnode_id, destination_device_id\n\t));\n\n\tlet node_addr = iroh::EndpointAddr::new(node_id);\n\tlet connection = endpoint\n\t\t.connect(node_addr, b\"spacedrive/filetransfer/1\")","sourceCodeStart":1098,"sourceCodeEnd":1134,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/ops/files/copy/strategy.rs#L1098-L1134","documentation":"Before dialing, the sender maps the destination device UUID to an Iroh node_id via the networking device registry; get_node_by_device returned None. Without a node_id no connection can be routed, so the transfer aborts before connecting. The registry only knows devices that have connected since the networking layer came up, so a missing entry means unknown or stale device state.","triggerScenarios":"Target device has never connected since networking was enabled; stale device rows in the library database referencing pre-networking installs; device was removed but is still referenced by the copy job; registry not yet populated at job dispatch time.","commonSituations":"Fresh installs where old devices appear in the library but have not reconnected, peer reinstalled or re-keyed (new node_id), jobs persisted from before a re-pair.","solutions":["Bring the target device online once so the registry records its node_id, then retry","Re-pair the target device if it was reinstalled or re-keyed","Verify destination_device_id still matches a live device in the library's device table","Restart both daemons to force registry re-registration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Resolve routing before starting the transfer.\nlet networking = ctx.networking_service().context(\"networking required\")?;\nlet registry = networking.device_registry().read().await;\nif registry.get_node_by_device(destination_device_id).is_none() {\n    anyhow::bail!(\n        \"Device {} is unknown to the network registry - bring it online first\",\n        destination_device_id\n    );\n}\ndrop(registry);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure paired devices connect at least once after daemon upgrades","Prune stale device records from libraries","Validate device ids against the registry before enqueueing remote jobs"],"tags":["network","device-registry","p2p","copy"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}