{"record":{"id":"ced39945cff3ecea","repo":"rustdesk/rustdesk","slug":"invalid-path","errorCode":null,"errorMessage":"Invalid path","messagePattern":"Invalid path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/base/src/fs.rs","lineNumber":612,"sourceCode":"    pub fn with_files(mut self, files: Vec<FileEntry>) -> ResultType<Self> {\n        self.set_files(files)?;\n        Ok(self)\n    }\n\n    pub fn new_read(\n        id: i32,\n        r#type: JobType,\n        remote: String,\n        data_source: DataSource,\n        file_num: i32,\n        show_hidden: bool,\n        is_remote: bool,\n        enable_overwrite_detection: bool,\n    ) -> ResultType<Self> {\n        log::info!(\"new read {}\", data_source);\n        let (files, total_size) = match &data_source {\n            DataSource::FilePath(p) => {\n                let p = p.to_str().ok_or(anyhow!(\"Invalid path\"))?;\n                let files = get_recursive_files(p, show_hidden)?;\n                let total_size = files.iter().map(|x| x.size).sum();\n                (files, total_size)\n            }\n            DataSource::MemoryCursor(c) => (Vec::new(), c.get_ref().len() as u64),\n        };\n        Ok(Self {\n            id,\n            r#type,\n            remote,\n            data_source,\n            file_num,\n            show_hidden,\n            is_remote,\n            files,\n            total_size,\n            enable_overwrite_detection,\n            ..Default::default()","sourceCodeStart":594,"sourceCodeEnd":630,"githubUrl":"https://github.com/rustdesk/rustdesk/blob/91c9fccbb0f7bfe5f11644d5fbdec9b23fa10540/libs/base/src/fs.rs#L594-L630","documentation":"Generic sentinel guard in new_read: a DataSource::FilePath whose path is not valid UTF-8 failed conversion via to_str(). This is not a filesystem error — the path never leaves the process; the fault is a non-UTF-8 OsStr path being passed into a JobConfig that requires string paths.","triggerScenarios":"Thrown at libs/base/src/fs.rs:612 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Convert the path to a lossy or re-encoded UTF-8 representation before creating the job","Use a path type that preserves non-UTF-8 bytes instead of String","Reject and surface the invalid-path request to the caller"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"91c9fccbb0f7bfe5f11644d5fbdec9b23fa10540","analyzedAt":"2026-09-10T19:53:44.083Z","contentChangedAt":"2026-09-10T19:53:44.083Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}