{"record":{"id":"4236ea95e68c22ad","repo":"gfx-rs/wgpu","slug":"failed-to-read-data-file","errorCode":null,"errorMessage":"Failed to read data file","messagePattern":"Failed to read data file","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu-core/src/device/trace/replay.rs","lineNumber":24,"sourceCode":"    fn load<'data>(&self, data: &'data Data) -> Cow<'data, [u8]>;\n    fn load_utf8<'data>(&self, data: &'data Data) -> Cow<'data, str>;\n}\n\n#[cfg(feature = \"std\")]\npub struct DiskTraceLoader<'a>(&'a std::path::Path);\n\n#[cfg(feature = \"std\")]\nimpl<'a> DiskTraceLoader<'a> {\n    pub fn new(path: &'a std::path::Path) -> DiskTraceLoader<'a> {\n        DiskTraceLoader(path)\n    }\n}\n\nimpl DataLoader for DiskTraceLoader<'_> {\n    fn load<'data>(&self, data: &'data Data) -> Cow<'data, [u8]> {\n        match data {\n            Data::File(file) => {\n                Cow::from(std::fs::read(self.0.join(file)).expect(\"Failed to read data file\"))\n            }\n            Data::String(_, s) => Cow::from(s.as_bytes()),\n            Data::Binary(_, b) => Cow::from(b),\n        }\n    }\n\n    /// Load UTF-8 string data\n    ///\n    /// # Panics\n    ///\n    /// If the data kind is not a string format or the data is not valid UTF-8\n    fn load_utf8<'data>(&self, data: &'data Data) -> Cow<'data, str> {\n        match data {\n            Data::File(file) => Cow::from(\n                std::fs::read_to_string(self.0.join(file)).expect(\"Failed to read data file\"),\n            ),\n            Data::String(kind, s) => {\n                assert!(kind.is_string(), \"{kind:?} cannot be loaded as a string\");","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu-core/src/device/trace/replay.rs#L6-L42","documentation":"Panic in DiskTraceLoader::load while replaying a trace: reading the referenced data file from the trace directory failed (missing file, permissions, or I/O error), so the replay cannot continue. The faulty input is the trace file path/data reference.","triggerScenarios":"Thrown at wgpu-core/src/device/trace/replay.rs:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the trace directory and all referenced data files exist and are readable before replaying","Re-capture the trace if the referenced file was lost"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}