{"record":{"id":"eae858c8cba933f7","repo":"spacedriveapp/spacedrive","slug":"remote-device-is-not-online","errorCode":null,"errorMessage":"Remote device {} is not online","messagePattern":"Remote device (.+?) is not online","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/cli/src/domains/library/mod.rs","lineNumber":343,"sourceCode":"\t\t})\n\t\t.collect();\n\n\tlet device_idx = select(\"Select remote device to sync with\", &device_choices)?;\n\tlet remote_device = &paired_devices.devices[device_idx];\n\tlet remote_device_id = remote_device.id;\n\n\tprintln!(\"\\n✓ Selected remote device: {}\\n\", remote_device.name);\n\n\t// Step 3: Discover remote libraries\n\tprintln!(\"Discovering libraries on remote device...\\n\");\n\n\tlet discovery_input = DiscoverRemoteLibrariesInput {\n\t\tdevice_id: remote_device_id,\n\t};\n\tlet discovery_out: DiscoverRemoteLibrariesOutput = execute_core_query!(ctx, discovery_input);\n\n\tif !discovery_out.is_online {\n\t\tanyhow::bail!(\"Remote device {} is not online\", remote_device.name);\n\t}\n\n\t// Step 4: Select sync action\n\tlet action_idx = select(\n\t\t\"Select sync action\",\n\t\t&[\n\t\t\t\"Share my library to remote device (create shared library from local)\".to_string(),\n\t\t\t\"Join remote library (use their existing library)\".to_string(),\n\t\t\t\"Merge libraries (combine two libraries) [NOT YET IMPLEMENTED]\".to_string(),\n\t\t],\n\t)?;\n\n\tlet action = match action_idx {\n\t\t0 => {\n\t\t\t// Share local library\n\t\t\tlet name = libraries[library_idx].name.clone();\n\n\t\t\tprintln!(","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/apps/cli/src/domains/library/mod.rs#L325-L361","documentation":"Thrown by the library sync wizard (step 3) when DiscoverRemoteLibrariesInput { device_id } returns a discovery output with is_online == false. The daemon could not reach the selected paired device, so remote library discovery cannot proceed. Note the wizard already showed connection status per device in step 2, so this means the device went offline (or was never reachable) between selection and discovery.","triggerScenarios":"Selecting a paired device that is powered off, whose daemon is not running, is on a different network, or behind a firewall; also selecting a device marked disconnected in the menu (the wizard does not block that choice).","commonSituations":"Remote machine asleep or daemon stopped; NAT/firewall blocking the P2P connection; stale pairing entry from a device that no longer exists; intermittent Wi-Fi on either side.","solutions":["Start or wake the remote device and ensure its sd-daemon is running","Verify connectivity with network status commands, then re-run 'sd library sync'","Pick a device shown as connected (green status) in the device selection list","If the pairing is stale, re-pair both devices with 'sd network pair generate' / 'sd network pair join'"],"exampleFix":"// before\nlet discovery_out: DiscoverRemoteLibrariesOutput = execute_core_query!(ctx, discovery_input);\nif !discovery_out.is_online {\n    anyhow::bail!(\"Remote device {} is not online\", remote_device.name);\n}\n\n// after: restrict the picker to connected devices so discovery cannot fail this way\nlet device_choices: Vec<String> = paired_devices\n    .devices\n    .iter()\n    .filter(|d| d.is_connected)\n    .map(|d| d.name.clone())\n    .collect();","handlingStrategy":"retry","validationCode":"// Prefer a device already reporting connected before running discovery\nlet online: Vec<_> = paired_devices.devices.iter().filter(|d| d.is_connected).collect();\nif online.is_empty() {\n    eprintln!(\"No connected devices; start the remote daemon first\");\n    return Ok(());\n}","typeGuard":"fn device_is_online(out: &DiscoverRemoteLibrariesOutput) -> bool {\n    out.is_online\n}","tryCatchPattern":"// Retry discovery a few times - devices can come online transiently\nlet mut attempt = 0;\nlet discovery_out = loop {\n    attempt += 1;\n    let out: DiscoverRemoteLibrariesOutput = execute_core_query!(ctx, discovery_input.clone());\n    if out.is_online || attempt >= 3 {\n        break out;\n    }\n    tokio::time::sleep(std::time::Duration::from_secs(5)).await;\n};\nanyhow::ensure!(discovery_out.is_online, \"Remote device {} is not online\", remote_device.name);","preventionTips":["Keep the remote daemon running and the machine awake before starting sync setup","Select devices shown as connected in the wizard's status column","Re-verify pairing when a device changes network or gets reinstalled"],"tags":["cli","network","sync","connectivity"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}