{"record":{"id":"267c38889dc234cf","repo":"vectordotdev/vector","slug":"data-poisoned","errorCode":null,"errorMessage":"Data poisoned","messagePattern":"Data poisoned","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/transforms/remap.rs","lineNumber":197,"sourceCode":"            drop_on_abort: self.drop_on_abort,\n            reroute_dropped: self.reroute_dropped,\n            runtime: self.runtime,\n            cache: Mutex::new(Default::default()),\n        }\n    }\n}\n\nimpl RemapConfig {\n    fn compile_vrl_program(\n        &self,\n        enrichment_tables: TableRegistry,\n        metrics_storage: MetricsStorage,\n        merged_schema_definition: schema::Definition,\n    ) -> Result<(Program, String, MeaningList)> {\n        if let Some((_, res)) = self\n            .cache\n            .lock()\n            .expect(\"Data poisoned\")\n            .iter()\n            .find(|v| v.0.0 == enrichment_tables && v.0.1 == merged_schema_definition)\n        {\n            return res.clone().map_err(Into::into);\n        }\n\n        let source = match (&self.source, &self.file, &self.files) {\n            (Some(source), None, None) => source.to_owned(),\n            (None, Some(path), None) => Self::read_file(path)?,\n            (None, None, Some(paths)) => {\n                let mut combined_source = String::new();\n                for path in paths {\n                    let content = Self::read_file(path)?;\n                    combined_source.push_str(&content);\n                    combined_source.push('\\n');\n                }\n                combined_source\n            }","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/vectordotdev/vector/blob/99894c8d8885659cc16efc39bd71f9fb3b59e296/src/transforms/remap.rs#L179-L215","documentation":"The remap transform caches compiled VRL programs behind a `std::sync::Mutex`; `.lock().expect(\"Data poisoned\")` panics when that mutex is poisoned, i.e. some thread panicked while holding it during an earlier compile. This site (src/transforms/remap.rs:197) is the cache lookup: once poisoned, every subsequent `compile_vrl_program` call — new transforms at topology build or config reload — panics with the same message.","triggerScenarios":"Any panic inside the critical section (most plausibly a panic during VRL compilation or a downstream expect while the cache lock is held) poisons the mutex; the next remap compilation on the same RemapConfig then hits \"Data poisoned\" at the lookup.","commonSituations":"Always the tail of another failure: search earlier in the logs for the original panic. Recurs on every config reload after the first compile-time panic, making Vector appear unable to reload configuration at all.","solutions":["Find the first panic preceding the \"Data poisoned\" message and fix its root cause (often a VRL compiler bug — upgrade Vector)","Restart Vector after fixing the root cause to clear the poisoned lock","If embedding/patching: use `lock().unwrap_or_else(|e| e.into_inner())` or parking_lot::Mutex (no poisoning) for a cache that should survive unrelated panics"],"exampleFix":"// before\nself.cache.lock().expect(\"Data poisoned\").iter().find(...)\n// after\nself.cache\n    .lock()\n    .unwrap_or_else(|poisoned| poisoned.into_inner())\n    .iter()\n    .find(...)","handlingStrategy":"fallback","validationCode":"# shell: a prior panic precedes every poisoning; surface it first\njournalctl -u vector | grep -B5 -m1 'panicked' | head -40","typeGuard":null,"tryCatchPattern":"// Rust (embedding): treat a poisoned compile cache as a cache miss, not a crash\nlet cache = self\n    .cache\n    .lock()\n    .unwrap_or_else(|poisoned| poisoned.into_inner()); // recover the still-valid map","preventionTips":["Investigate the first panic in the log, not the \"Data poisoned\" tail","Restart Vector after fixing the root cause to clear poisoned locks","Prefer parking_lot::Mutex (no poisoning) for caches in forks/embeddings"],"tags":["mutex","poisoning","remap","vrl","panic"],"backgroundTag":"mutex-poisoned","analyzedSha":"99894c8d8885659cc16efc39bd71f9fb3b59e296","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}