spacedriveapp/spacedrive · warning · anyhow::Error

Volume not mounted, cannot verify path existence

Error message

Volume not mounted, cannot verify path existence

What it means

During indexing change detection, the volume backend's exists() returned VolumeError::NotMounted. The handler cannot verify whether a changed path still exists, so it warn-logs and returns an error rather than guessing deleted-or-not. The correct mental model is deferred work: once the volume is remounted, a rescan reconciles state.

Source

Thrown at core/src/ops/indexing/change_detection/handler.rs:74

/// Check if a path exists, distinguishing between "doesn't exist" and "can't access".
///
/// Critical for preventing false deletions when volumes go offline.
pub async fn path_exists_safe(
	path: &Path,
	backend: Option<&Arc<dyn crate::volume::VolumeBackend>>,
) -> Result<bool> {
	use crate::volume::error::VolumeError;

	if let Some(backend) = backend {
		match backend.exists(path).await {
			Ok(exists) => Ok(exists),
			Err(VolumeError::NotMounted(_)) => {
				tracing::warn!(
					"Volume not mounted when checking path existence: {}",
					path.display()
				);
				Err(anyhow::anyhow!(
					"Volume not mounted, cannot verify path existence"
				))
			}
			Err(VolumeError::Io(ref e)) if e.kind() == std::io::ErrorKind::NotFound => Ok(false),
			Err(VolumeError::Io(io_err)) => {
				tracing::warn!(
					"IO error when checking path existence for {}: {}",
					path.display(),
					io_err
				);
				Err(anyhow::anyhow!(
					"IO error, volume may be offline: {}",
					io_err
				))
			}
			Err(e) => {
				tracing::warn!(
					"Volume error when checking path existence for {}: {}",

View on GitHub (pinned to 6dfeccf211)

Solutions

  1. Remount or reconnect the volume, then trigger a rescan of its location
  2. Pause or skip indexing jobs for volumes known to be offline instead of letting them fail
  3. Check mount status before starting scans over a volume's paths
  4. If the volume is permanently gone, remove its location from the library
Defensive patterns

Strategy: fallback

Validate before calling

// Probe the volume root before running change detection over its paths.
if let Some(backend) = backend {
    if matches!(backend.exists(location_root).await, Err(VolumeError::NotMounted(_))) {
        // volume offline: defer this event batch instead of failing the handler
    }
}

Prevention

When it happens

Trigger: External drive unplugged, network share disconnected, or cloud volume logged out while the indexer processes events whose paths live on that volume.

Common situations: USB drives removed without ejecting, laptops waking before network volumes reconnect, cloud storage credentials expiring mid-session.

Related errors


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