{"record":{"id":"61a1d08eb3fd0513","repo":"spacedriveapp/spacedrive","slug":"device-config-not-found-please-specify-local-de","errorCode":null,"errorMessage":"Device config not found. Please specify --local-device","messagePattern":"Device config not found\\. Please specify --local-device","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/cli/src/domains/library/args.rs","lineNumber":150,"sourceCode":"\t\tself.interactive || (self.local_library.is_none() && self.remote_device.is_none())\n\t}\n\n\tpub fn to_input(&self, ctx: &crate::context::Context) -> anyhow::Result<LibrarySyncSetupInput> {\n\t\tlet local_library = self\n\t\t\t.local_library\n\t\t\t.ok_or_else(|| anyhow::anyhow!(\"--local-library is required\"))?;\n\t\tlet remote_device = self\n\t\t\t.remote_device\n\t\t\t.ok_or_else(|| anyhow::anyhow!(\"--remote-device is required\"))?;\n\n\t\t// Get local device ID from config or argument\n\t\tlet local_device_id = if let Some(id) = self.local_device {\n\t\t\tid\n\t\t} else {\n\t\t\t// Read device config to get current device ID\n\t\t\tlet config_path = ctx.data_dir.join(\"device.json\");\n\t\t\tif !config_path.exists() {\n\t\t\t\tanyhow::bail!(\"Device config not found. Please specify --local-device\");\n\t\t\t}\n\t\t\tlet config_data = std::fs::read_to_string(&config_path)?;\n\t\t\tlet device_config: sd_core::device::DeviceConfig = serde_json::from_str(&config_data)?;\n\t\t\tdevice_config.id\n\t\t};\n\n\t\t// Determine leader device ID\n\t\tlet leader = self.leader.as_deref().unwrap_or(\"local\");\n\t\tlet leader_device_id = match leader {\n\t\t\t\"local\" => local_device_id,\n\t\t\t\"remote\" => remote_device,\n\t\t\t_ => anyhow::bail!(\"Leader must be 'local' or 'remote'\"),\n\t\t};\n\n\t\t// Parse action\n\t\tlet action_str = self.action.as_deref().unwrap_or(\"share-local\");\n\t\tlet action =\n\t\t\tmatch action_str {","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/apps/cli/src/domains/library/args.rs#L132-L168","documentation":"Error \"Device config not found. Please specify --local-device\" thrown in spacedriveapp/spacedrive.","triggerScenarios":"Thrown at apps/cli/src/domains/library/args.rs:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}