spacedriveapp/spacedrive · error · anyhow::Error

Device config not found. Please specify --local-device

Error message

Device config not found. Please specify --local-device

What it means

Error "Device config not found. Please specify --local-device" thrown in spacedriveapp/spacedrive.

Source

Thrown at apps/cli/src/domains/library/args.rs:150

		self.interactive || (self.local_library.is_none() && self.remote_device.is_none())
	}

	pub fn to_input(&self, ctx: &crate::context::Context) -> anyhow::Result<LibrarySyncSetupInput> {
		let local_library = self
			.local_library
			.ok_or_else(|| anyhow::anyhow!("--local-library is required"))?;
		let remote_device = self
			.remote_device
			.ok_or_else(|| anyhow::anyhow!("--remote-device is required"))?;

		// Get local device ID from config or argument
		let local_device_id = if let Some(id) = self.local_device {
			id
		} else {
			// Read device config to get current device ID
			let config_path = ctx.data_dir.join("device.json");
			if !config_path.exists() {
				anyhow::bail!("Device config not found. Please specify --local-device");
			}
			let config_data = std::fs::read_to_string(&config_path)?;
			let device_config: sd_core::device::DeviceConfig = serde_json::from_str(&config_data)?;
			device_config.id
		};

		// Determine leader device ID
		let leader = self.leader.as_deref().unwrap_or("local");
		let leader_device_id = match leader {
			"local" => local_device_id,
			"remote" => remote_device,
			_ => anyhow::bail!("Leader must be 'local' or 'remote'"),
		};

		// Parse action
		let action_str = self.action.as_deref().unwrap_or("share-local");
		let action =
			match action_str {

View on GitHub (pinned to 6dfeccf211)

When it happens

Trigger: Thrown at apps/cli/src/domains/library/args.rs:150 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16). Data as JSON: /api/errors/61a1d08eb3fd0513. Report an issue: GitHub.