{"record":{"id":"0b6cd86aa0e00170","repo":"spacedriveapp/spacedrive","slug":"no-libraries-found-on-remote-device-use-share-my","errorCode":null,"errorMessage":"No libraries found on remote device. Use 'Share my library' instead.","messagePattern":"No libraries found on remote device\\. Use 'Share my library' instead\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/cli/src/domains/library/mod.rs","lineNumber":374,"sourceCode":"\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!(\n\t\t\t\t\"\\n✓ Will share library '{}' to remote device '{}'\\n\",\n\t\t\t\tname, remote_device.name\n\t\t\t);\n\n\t\t\t(\n\t\t\t\tLibrarySyncAction::ShareLocalLibrary { library_name: name },\n\t\t\t\tNone,\n\t\t\t)\n\t\t}\n\t\t1 => {\n\t\t\t// Join remote library\n\t\t\tif discovery_out.libraries.is_empty() {\n\t\t\t\tanyhow::bail!(\n\t\t\t\t\t\"No libraries found on remote device. Use 'Share my library' instead.\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet remote_lib_choices: Vec<String> = discovery_out\n\t\t\t\t.libraries\n\t\t\t\t.iter()\n\t\t\t\t.map(|lib| {\n\t\t\t\t\tformat!(\n\t\t\t\t\t\t\"{} ({} entries, {} locations)\",\n\t\t\t\t\t\tlib.name, lib.statistics.total_files, lib.statistics.location_count\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.collect();\n\n\t\t\tlet remote_lib_idx = select(\"Select remote library to join\", &remote_lib_choices)?;\n\t\t\tlet remote_library = &discovery_out.libraries[remote_lib_idx];\n","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/apps/cli/src/domains/library/mod.rs#L356-L392","documentation":"Thrown by the library sync wizard when the user chooses option 1 ('Join remote library') but the discovery result from the remote device contains zero libraries. Joining requires an existing remote library, so the wizard aborts and points you at the 'Share my library' path instead, which creates a library from the local side.","triggerScenarios":"Choosing 'Join remote library' after 'sd library sync' with a remote device that has no libraries yet (fresh remote install, or the remote library list is empty).","commonSituations":"Two fresh devices paired for the first time; remote user deleted all their libraries; testing sync between two dev daemons that were just initialized.","solutions":["Choose 'Share my library to remote device' (option 0) instead, which creates the shared library from your local library","Or create a library on the remote device first, then re-run the wizard and join it","Verify what the remote actually exposes by re-running discovery once the remote has a library"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if discovery_out.libraries.is_empty() {\n    println!(\"Remote has no libraries; falling back to 'Share my library' flow\");\n    // proceed with LibrarySyncAction::ShareLocalLibrary { library_name }\n}","typeGuard":"fn can_join_remote(discovery: &DiscoverRemoteLibrariesOutput) -> bool {\n    !discovery.libraries.is_empty()\n}","tryCatchPattern":null,"preventionTips":["Inspect the wizard's remote library list (entries/locations counts) before choosing Join","Create a library on the remote device first if you specifically want to join it","Treat 'Share my library' as the default path between fresh devices"],"tags":["cli","sync","library","interactive"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}