{"record":{"id":"f9cfffaa270062f5","repo":"quickwit-oss/quickwit","slug":"failed-to-find-dest-path","errorCode":null,"errorMessage":"failed to find dest_path {:?}","messagePattern":"failed to find dest_path (.+?)","errorType":"exception","errorClass":"StorageError","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-storage/src/ram_storage.rs","lineNumber":101,"sourceCode":"impl Storage for RamStorage {\n    async fn check_connectivity(&self) -> anyhow::Result<()> {\n        Ok(())\n    }\n\n    async fn put(\n        &self,\n        path: &Path,\n        payload: Box<dyn crate::PutPayload>,\n    ) -> crate::StorageResult<()> {\n        let payload_bytes = payload.read_all().await?;\n        self.put_data(path, payload_bytes).await;\n        Ok(())\n    }\n\n    async fn copy_to(&self, path: &Path, output: &mut dyn SendableAsync) -> StorageResult<()> {\n        let payload_bytes = self.get_data(path).await.ok_or_else(|| {\n            StorageErrorKind::NotFound\n                .with_error(anyhow::anyhow!(\"failed to find dest_path {:?}\", path))\n        })?;\n        output.write_all(&payload_bytes).await?;\n        output.flush().await?;\n        Ok(())\n    }\n\n    async fn get_slice(&self, path: &Path, range: Range<usize>) -> StorageResult<OwnedBytes> {\n        let payload_bytes = self.get_data(path).await.ok_or_else(|| {\n            StorageErrorKind::NotFound\n                .with_error(anyhow::anyhow!(\"failed to find dest_path {:?}\", path))\n        })?;\n        Ok(payload_bytes.slice(range.start..range.end))\n    }\n\n    async fn get_slice_stream(\n        &self,\n        path: &Path,\n        range: Range<usize>,","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-storage/src/ram_storage.rs#L83-L119","documentation":"`RamStorage::copy_to` fetches the whole in-memory payload via `get_data`; if the path is absent from the in-memory map, it raises a NotFound StorageError with the (misleading) message \"failed to find dest_path\". Despite the wording, `path` is the source path whose contents are copied to `output`.","triggerScenarios":"Calling `Storage::copy_to` on a RamStorage for a key that was never inserted or was removed (e.g. after `bulk_delete` or `delete`).","commonSituations":"Unit/integration tests where the RamStorage was not prepopulated with the expected file (RamStorageBuilder missing the entry); metastore tests simulating storage failure; reading a file from the wrong storage instance.","solutions":["Ensure the path exists in the RamStorage before copying — add it via RamStorageBuilder/`put` in test setup","Check for typos or a path/prefix mismatch between the writer and the reader of the RAM storage","If simulating deletion, expect NotFound and assert on StorageErrorKind::NotFound rather than treating it as a bug","Verify you are reading from the same RamStorage instance that was written to"],"exampleFix":"// before\nlet ram = RamStorage::default();\nstorage.copy_to(&Path::from(\"meta.json\"), &mut out).await?;\n// after\nlet ram = RamStorage::builder().put(\"meta.json\", payload).build();\nram.copy_to(&Path::from(\"meta.json\"), &mut out).await?;","handlingStrategy":"try-catch","validationCode":"let exists = ram_storage.exists(&path).await.unwrap_or(false);\nif !exists { seed_or_fail(path); }","typeGuard":null,"tryCatchPattern":"match storage.copy_to(&path, &mut out).await {\n    Ok(()) => {},\n    Err(e) if e.kind() == StorageErrorKind::NotFound => seed_ram_storage_or_skip(path),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Seed RamStorage via RamStorageBuilder in tests before any read","Reuse the same RamStorage instance for writes and reads in a test","Remember the message says dest_path but the missing path is the source","Account for delete/bulk_delete side effects before later reads"],"tags":["ram-storage","not-found","storage","tests"],"backgroundTag":"file-not-found","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}