{"record":{"id":"8222ebcfbe0a963c","repo":"spacedriveapp/spacedrive","slug":"entry-not-found","errorCode":null,"errorMessage":"Entry not found","messagePattern":"Entry not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/src/ops/indexing/change_detection/persistent.rs","lineNumber":437,"sourceCode":"\t\t\treturn Ok(());\n\t\t};\n\n\t\tlet proc_config = load_location_processor_config(self.location_id, &self.db)\n\t\t\t.await\n\t\t\t.unwrap_or_default();\n\n\t\tlet build_proc_entry = |db: &sea_orm::DatabaseConnection,\n\t\t                        entry: &EntryRef|\n\t\t -> std::pin::Pin<\n\t\t\tBox<dyn std::future::Future<Output = Result<ProcessorEntry>> + Send + '_>,\n\t\t> {\n\t\t\tlet entry = entry.clone();\n\t\t\tlet db = db.clone();\n\t\t\tBox::pin(async move {\n\t\t\t\tlet db_entry = entities::entry::Entity::find_by_id(entry.id)\n\t\t\t\t\t.one(&db)\n\t\t\t\t\t.await?\n\t\t\t\t\t.ok_or_else(|| anyhow::anyhow!(\"Entry not found\"))?;\n\n\t\t\t\tlet mime_type = if let Some(content_id) = db_entry.content_id {\n\t\t\t\t\tif let Ok(Some(ci)) = entities::content_identity::Entity::find_by_id(content_id)\n\t\t\t\t\t\t.one(&db)\n\t\t\t\t\t\t.await\n\t\t\t\t\t{\n\t\t\t\t\t\tif let Some(mime_id) = ci.mime_type_id {\n\t\t\t\t\t\t\tif let Ok(Some(mime)) = entities::mime_type::Entity::find_by_id(mime_id)\n\t\t\t\t\t\t\t\t.one(&db)\n\t\t\t\t\t\t\t\t.await\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSome(mime.mime_type)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tNone\n\t\t\t\t\t\t}","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/ops/indexing/change_detection/persistent.rs#L419-L455","documentation":"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.","triggerScenarios":"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.","commonSituations":"User deletes files immediately after adding them while processors are queued; long processor backlog; indexer rebuild dropping and recreating entry rows with new ids.","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"],"exampleFix":"// before\nlet db_entry = entities::entry::Entity::find_by_id(entry.id)\n    .one(&db)\n    .await?\n    .ok_or_else(|| anyhow::anyhow!(\"Entry not found\"))?;\n\n// after: deletion after scheduling is expected; skip this entry\nlet Some(db_entry) = entities::entry::Entity::find_by_id(entry.id)\n    .one(&db)\n    .await?\nelse {\n    continue; // or return a 'skipped' ProcessorEntry\n};","handlingStrategy":"try-catch","validationCode":"// Before dispatching processors, confirm the entry still exists\nlet alive = entities::entry::Entity::find_by_id(entry.id)\n    .one(&db).await?.is_some();\nif !alive { /* drop this entry from the batch */ }","typeGuard":null,"tryCatchPattern":"let db_entry = match entities::entry::Entity::find_by_id(entry.id).one(&db).await? {\n    Some(e) => e,\n    None => {\n        tracing::debug!(id = entry.id, \"entry deleted before processing; skipping\");\n        continue;\n    }\n};","preventionTips":["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"],"tags":["indexing","media-processors","database","race-condition"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}