{"record":{"id":"9e78e906919811b9","repo":"libnyanpasu/clash-nyanpasu","slug":"no-mirrors-found","errorCode":null,"errorMessage":"no mirrors found","messagePattern":"no mirrors found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/tauri/src/core/updater/mod.rs","lineNumber":207,"sourceCode":"        self.manifest_version = latest;\n        Ok(())\n    }\n\n    // TODO: add user-spec mirror support\n    pub async fn mirror_speed_test(&self) -> Result<()> {\n        {\n            let mirror = self.mirror.read();\n            if let Some((_, timestamp)) = mirror.as_ref()\n                && chrono::Utc::now().timestamp() - (*timestamp as i64) < 3600\n            {\n                return Ok(());\n            }\n        }\n        let mirrors = crate::utils::candy::INTERNAL_MIRRORS;\n        let path = \"https://github.com/libnyanpasu/clash-nyanpasu/raw/main/manifest/version.json\";\n        let client = crate::utils::candy::get_reqwest_client()?;\n        let results = client.mirror_speed_test(mirrors, path).await?;\n        let (fastest_mirror, speed) = results.first().ok_or(anyhow!(\"no mirrors found\"))?;\n        if speed - 1.0 < 0.0001 {\n            anyhow::bail!(\"all mirrors are too slow\");\n        }\n        tracing::debug!(\"fastest mirror: {}, speed: {}\", fastest_mirror, speed);\n        {\n            let mut mirror = self.mirror.write();\n            *mirror = Some((\n                fastest_mirror.to_string(),\n                chrono::Utc::now().timestamp() as u64,\n            ));\n        }\n        Ok(())\n    }\n\n    pub async fn update_core(\n        &mut self,\n        core_type: &ClashCore,\n        nyanpasu: crate::client::NyanpasuClient,","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/tauri/src/core/updater/mod.rs#L189-L225","documentation":"mirror_speed_test tests the INTERNAL_MIRRORS against a fixed GitHub version.json path and takes the fastest result. If the results slice is empty (no mirror produced any measurement), ok_or throws 'no mirrors found'. It indicates the mirror speed test returned no usable entries at all.","triggerScenarios":"Calling fetch_latest or update_core, which invoke mirror_speed_test, when client.mirror_speed_test() returns an empty Vec - e.g. all mirror requests failed before producing a speed entry.","commonSituations":"Full network outage, firewall/proxy blocking all mirror hosts, DNS failures, or a reqwest client configured without usable network interfaces.","solutions":["Check network connectivity and proxy settings; the mirror test needs outbound HTTPS to the mirror hosts","Verify INTERNAL_MIRRORS is non-empty and hosts are reachable (curl each mirror URL)","Inspect the reqwest client configuration (timeouts, proxy) used by get_reqwest_client"],"exampleFix":"// before\nlet (fastest_mirror, speed) = results.first().ok_or(anyhow!(\"no mirrors found\"))?;\n// after\nif results.is_empty() { anyhow::bail!(\"mirror speed test failed: no mirror responded; check network/proxy\"); }\nlet (fastest_mirror, speed) = results.first().unwrap();","handlingStrategy":"try-catch","validationCode":"// probe connectivity before running the update flow\nif reqwest::get(\"https://github.com\").await.is_err() {\n    eprintln!(\"network unavailable; mirror speed test will find no mirrors\");\n}","typeGuard":null,"tryCatchPattern":"match updater.update_core(core_type, client).await {\n    Ok(n) => n,\n    Err(e) if e.to_string().contains(\"no mirrors found\") || e.to_string().contains(\"too slow\") => /* surface network/proxy guidance to user */,\n    Err(e) => return Err(e),\n}","preventionTips":["Verify outbound HTTPS and proxy configuration before core updates","Keep INTERNAL_MIRRORS populated with reachable hosts","Add per-mirror diagnostics so total failure is distinguishable from slow mirrors"],"tags":["network","updater","mirror","rust"],"backgroundTag":"empty-result-set","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"}