libnyanpasu/clash-nyanpasu · error

failed to find core file in a zip archive

Error message

failed to find core file in a zip archive

What it means

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.

Source

Thrown at backend/tauri/src/core/updater/instance.rs:195

                    let mut archive = zip::ZipArchive::new(tmp_file)?;
                    let len = archive.len();
                    for i in 0..len {
                        let mut file = archive.by_index(i)?;
                        let file_name = file.name();
                        tracing::debug!("Filename: {}", file.name());
                        // TODO: 在 enum 做点魔法
                        if file_name.contains("mihomo")
                            || file_name.contains("clash")
                            || file_name.contains("meow")
                        {
                            tracing::debug!("extract file: {}", file_name);
                            tracing::debug!("extract file size: {}", file.size());
                            std::io::copy(&mut file, &mut buff)?;
                            break;
                        }
                        if i == len - 1 {
                            anyhow::bail!("failed to find core file in a zip archive");
                        }
                    }

View on GitHub (pinned to f7dbce2997)

Solutions

  1. Re-trigger the core update to re-download the archive; the current one is likely corrupt or truncated.
  2. Verify the downloaded release asset is the correct core package (its zip must contain a binary named with mihomo/clash/meow).
  3. Check the mirror used for the download; switch mirrors and retry.
  4. Clear the temporary download directory so a stale/wrong file is not reused.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at backend/tauri/src/core/updater/instance.rs:195 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of libnyanpasu/clash-nyanpasu@f7dbce2997 (2026-09-08). Data as JSON: /api/errors/d9b581b4f32d5ee6. Report an issue: GitHub.