spacedriveapp/spacedrive · error · anyhow::Error
Remote device {} is not online
Error message
Remote device {} is not online What it means
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.
Source
Thrown at apps/cli/src/domains/library/mod.rs:343
})
.collect();
let device_idx = select("Select remote device to sync with", &device_choices)?;
let remote_device = &paired_devices.devices[device_idx];
let remote_device_id = remote_device.id;
println!("\n✓ Selected remote device: {}\n", remote_device.name);
// Step 3: Discover remote libraries
println!("Discovering libraries on remote device...\n");
let discovery_input = DiscoverRemoteLibrariesInput {
device_id: remote_device_id,
};
let discovery_out: DiscoverRemoteLibrariesOutput = execute_core_query!(ctx, discovery_input);
if !discovery_out.is_online {
anyhow::bail!("Remote device {} is not online", remote_device.name);
}
// Step 4: Select sync action
let action_idx = select(
"Select sync action",
&[
"Share my library to remote device (create shared library from local)".to_string(),
"Join remote library (use their existing library)".to_string(),
"Merge libraries (combine two libraries) [NOT YET IMPLEMENTED]".to_string(),
],
)?;
let action = match action_idx {
0 => {
// Share local library
let name = libraries[library_idx].name.clone();
println!(View on GitHub (pinned to 6dfeccf211)
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'
Example fix
// before
let discovery_out: DiscoverRemoteLibrariesOutput = execute_core_query!(ctx, discovery_input);
if !discovery_out.is_online {
anyhow::bail!("Remote device {} is not online", remote_device.name);
}
// after: restrict the picker to connected devices so discovery cannot fail this way
let device_choices: Vec<String> = paired_devices
.devices
.iter()
.filter(|d| d.is_connected)
.map(|d| d.name.clone())
.collect(); Defensive patterns
Strategy: retry
Validate before calling
// Prefer a device already reporting connected before running discovery
let online: Vec<_> = paired_devices.devices.iter().filter(|d| d.is_connected).collect();
if online.is_empty() {
eprintln!("No connected devices; start the remote daemon first");
return Ok(());
} Type guard
fn device_is_online(out: &DiscoverRemoteLibrariesOutput) -> bool {
out.is_online
} Try / catch
// Retry discovery a few times - devices can come online transiently
let mut attempt = 0;
let discovery_out = loop {
attempt += 1;
let out: DiscoverRemoteLibrariesOutput = execute_core_query!(ctx, discovery_input.clone());
if out.is_online || attempt >= 3 {
break out;
}
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
};
anyhow::ensure!(discovery_out.is_online, "Remote device {} is not online", remote_device.name); Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- No paired devices found. Pair a device first with: sd networ
- Failed to connect to {}: {}
- Failed to connect to {}: {}
- No libraries found on remote device. Use 'Share my library'
- Library merging is not yet implemented
AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16).
Data as JSON: /api/errors/eae858c8cba933f7.
Report an issue: GitHub.