spacedriveapp/spacedrive · warning · anyhow::Error

Invalid sidecar status: {}

Error message

Invalid sidecar status: {}

What it means

Converting the sidecar row's status string into its typed enum via TryInto failed; the passthrough error names the invalid status. The stored status is not a value this build recognizes, which aborts the availability listing for that content.

Source

Thrown at core/src/service/sidecar_manager.rs:176

					&SidecarVariant::new(&sidecar.variant),
					&sidecar
						.format
						.as_str()
						.try_into()
						.map_err(|e: String| anyhow::anyhow!(e))?,
				)
				.await?;

			entry.insert(
				sidecar.variant.clone(),
				SidecarPresence {
					local: true,
					path: Some(path.relative_path),
					status: sidecar
						.status
						.as_str()
						.try_into()
						.map_err(|e: String| anyhow::anyhow!(e))?,
					devices: vec![],
				},
			);
		}

		// Query availability on other devices
		let availability = SidecarAvailability::find()
			.filter(sidecar_availability::Column::ContentUuid.is_in(content_uuids.to_vec()))
			.filter(sidecar_availability::Column::Kind.eq(kind.as_str()))
			.filter(
				sidecar_availability::Column::Variant.is_in(variants.iter().map(|v| v.as_str())),
			)
			.filter(sidecar_availability::Column::Has.eq(true))
			.all(db.conn())
			.await?;

		// Add remote device availability
		for avail in availability {

View on GitHub (pinned to 6dfeccf211)

Solutions

  1. Inspect and normalize status values in the sidecar table for the affected rows
  2. Skip rows with unknown statuses and log a warning rather than failing the listing
  3. Migrate status values on upgrade whenever the enum changes

Example fix

// before
let status = sidecar.status.as_str().try_into().map_err(|e: String| anyhow::anyhow!(e))?;

// after
let Ok(status) = SidecarStatus::try_from(sidecar.status.as_str()) else {
    warn!(status = %sidecar.status, "unknown sidecar status, skipping row");
    continue;
};
Defensive patterns

Strategy: fallback

Validate before calling

let known: Vec<&SidecarRow> = rows.iter().filter(|r| SidecarStatus::try_from(r.status.as_str()).is_ok()).collect();

Type guard

fn is_known_sidecar_status(value: &str) -> bool {
    SidecarStatus::try_from(value).is_ok()
}

Try / catch

match SidecarStatus::try_from(sidecar.status.as_str()) {
    Ok(status) => { /* use it */ }
    Err(_) => {
        warn!(status = %sidecar.status, "unknown sidecar status, skipping row");
        continue;
    }
}

Prevention

When it happens

Trigger: A status written by a different version (statuses added or renamed); imported or hand-edited sidecar rows; partial writes leaving malformed status text.

Common situations: Version upgrades changing the status set; sync conflicts writing statuses the local build cannot parse.

Related errors


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