spacedriveapp/spacedrive · error
Entry not found
Error message
Entry not found
What it means
Inside the processor-pipeline builder (build_proc_entry), each scheduled EntryRef is re-fetched from the DB to assemble a ProcessorEntry. This error fires when that row no longer exists: the entry was deleted after the job was planned but before the processor ran. The closure loads mime/content data, so it needs the live row.
Source
Thrown at core/src/ops/indexing/change_detection/persistent.rs:437
return Ok(());
};
let proc_config = load_location_processor_config(self.location_id, &self.db)
.await
.unwrap_or_default();
let build_proc_entry = |db: &sea_orm::DatabaseConnection,
entry: &EntryRef|
-> std::pin::Pin<
Box<dyn std::future::Future<Output = Result<ProcessorEntry>> + Send + '_>,
> {
let entry = entry.clone();
let db = db.clone();
Box::pin(async move {
let db_entry = entities::entry::Entity::find_by_id(entry.id)
.one(&db)
.await?
.ok_or_else(|| anyhow::anyhow!("Entry not found"))?;
let mime_type = if let Some(content_id) = db_entry.content_id {
if let Ok(Some(ci)) = entities::content_identity::Entity::find_by_id(content_id)
.one(&db)
.await
{
if let Some(mime_id) = ci.mime_type_id {
if let Ok(Some(mime)) = entities::mime_type::Entity::find_by_id(mime_id)
.one(&db)
.await
{
Some(mime.mime_type)
} else {
None
}
} else {
None
}View on GitHub (pinned to 6dfeccf211)
Solutions
- Skip entries whose row is gone instead of failing the whole processor job
- Cancel queued processor tasks for entries removed by the delete path
- Reduce the plan-to-execute window by processing in smaller batches
Example fix
// before
let db_entry = entities::entry::Entity::find_by_id(entry.id)
.one(&db)
.await?
.ok_or_else(|| anyhow::anyhow!("Entry not found"))?;
// after: deletion after scheduling is expected; skip this entry
let Some(db_entry) = entities::entry::Entity::find_by_id(entry.id)
.one(&db)
.await?
else {
continue; // or return a 'skipped' ProcessorEntry
}; Defensive patterns
Strategy: try-catch
Validate before calling
// Before dispatching processors, confirm the entry still exists
let alive = entities::entry::Entity::find_by_id(entry.id)
.one(&db).await?.is_some();
if !alive { /* drop this entry from the batch */ } Try / catch
let db_entry = match entities::entry::Entity::find_by_id(entry.id).one(&db).await? {
Some(e) => e,
None => {
tracing::debug!(id = entry.id, "entry deleted before processing; skipping");
continue;
}
}; Prevention
- Skip (do not fail) processor entries whose rows vanished
- Cancel queued processor work when entries are deleted
- Process in small batches to shrink the schedule-to-run window
When it happens
Trigger: A media processor (OCR, thumbnail, proxy) scheduled for an entry that is deleted before execution; job queue draining slowly while the user deletes files; reindex clearing entries with processors still queued.
Common situations: User deletes files immediately after adding them while processors are queued; long processor backlog; indexer rebuild dropping and recreating entry rows with new ids.
Related errors
- Entry {} not found after ID lookup
- Entry not found after creation
- Failed to update entry: {}
- Library not found: {}
- Location not found: {}
AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16).
Data as JSON: /api/errors/8222ebcfbe0a963c.
Report an issue: GitHub.