{"record":{"id":"d9b581b4f32d5ee6","repo":"libnyanpasu/clash-nyanpasu","slug":"failed-to-find-core-file-in-a-zip-archive","errorCode":null,"errorMessage":"failed to find core file in a zip archive","messagePattern":"failed to find core file in a zip archive","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/tauri/src/core/updater/instance.rs","lineNumber":195,"sourceCode":"                    let mut archive = zip::ZipArchive::new(tmp_file)?;\n                    let len = archive.len();\n                    for i in 0..len {\n                        let mut file = archive.by_index(i)?;\n                        let file_name = file.name();\n                        tracing::debug!(\"Filename: {}\", file.name());\n                        // TODO: 在 enum 做点魔法\n                        if file_name.contains(\"mihomo\")\n                            || file_name.contains(\"clash\")\n                            || file_name.contains(\"meow\")\n                        {\n                            tracing::debug!(\"extract file: {}\", file_name);\n                            tracing::debug!(\"extract file size: {}\", file.size());\n                            std::io::copy(&mut file, &mut buff)?;\n                            break;\n                        }\n                        if i == len - 1 {\n                            anyhow::bail!(\"failed to find core file in a zip archive\");\n                        }\n                    }","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/tauri/src/core/updater/instance.rs#L177-L213","documentation":"decompress_and_set_permission iterates every entry of the downloaded update zip looking for a filename containing \"mihomo\", \"clash\", or \"meow\"; when the loop reaches the last entry (i == len - 1) without a match, it bails. This fires when the archive is not a valid core update package — e.g. a wrong, corrupt, or renamed release asset was downloaded — so no core binary can be extracted.","triggerScenarios":"Thrown at backend/tauri/src/core/updater/instance.rs:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-trigger the core update to re-download the archive; the current one is likely corrupt or truncated.","Verify the downloaded release asset is the correct core package (its zip must contain a binary named with mihomo/clash/meow).","Check the mirror used for the download; switch mirrors and retry.","Clear the temporary download directory so a stale/wrong file is not reused."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f7dbce2997c633e484f54788035e770b3ee99773","analyzedAt":"2026-09-08T01:24:59.197Z","contentChangedAt":"2026-09-08T01:24:59.197Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}