libnyanpasu/clash-nyanpasu · error

no matches found for core type

Error message

no matches found for core type: {:?}

What it means

update_core asks manifest_version.get_matches(core_type) for the release artifact matching the requested core type. If the downloaded version manifest has no entry for that core type (mihomo/clash-rs/clash), the Option is None and this error is thrown. It means the manifest is reachable but does not cover the requested core.

Solutions

  1. Verify the requested core type is spelled/supported and present in the upstream manifest/version.json
  2. Refresh or clear the cached manifest so get_matches sees the current release list
  3. Update the app - the manifest schema may have changed relative to your build

Example fix

// before
let (artifact, tag) = self.manifest_version.get_matches(core_type).ok_or(anyhow!("no matches found for core type: {:?}", core_type))?;
// after
let Some((artifact, tag)) = self.manifest_version.get_matches(core_type) else {
    anyhow::bail!("core type {:?} not found in manifest; available: {:?}", core_type, self.manifest_version.available_core_types());
};
Defensive patterns

Strategy: validation

Validate before calling

// check the core type exists in the manifest before updating
let manifest = updater.manifest_version.clone();
if manifest.get_matches(&core_type).is_none() {
    eprintln!("core type {:?} not present in version manifest; skipping update", core_type);
}

Type guard

fn core_supported(manifest: &ManifestVersion, core_type: &CoreType) -> bool {
    manifest.get_matches(core_type).is_some()
}

Try / catch

match updater.update_core(core_type, nyanpasu).await {
    Ok(n) => n,
    Err(e) if e.to_string().contains("no matches found for core type") => /* report unsupported core; refresh manifest or update app */,
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling update_core with a CoreType whose key is absent from the fetched manifest/version.json - e.g. requesting a core the upstream manifest no longer ships, or a freshly added core type before the manifest includes it.

Common situations: App version older/newer than the manifest schema, upstream renamed or dropped a core artifact, custom core type passed programmatically, or a cached/partial manifest.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at backend/tauri/src/core/updater/mod.rs:231

            let mut mirror = self.mirror.write();
            *mirror = Some((
                fastest_mirror.to_string(),
                chrono::Utc::now().timestamp() as u64,
            ));
        }
        Ok(())
    }

    pub async fn update_core(
        &mut self,
        core_type: &ClashCore,
        nyanpasu: crate::client::NyanpasuClient,
    ) -> Result<usize> {
        self.mirror_speed_test().await?;
        let (artifact, tag) = self
            .manifest_version
            .get_matches(core_type)
            .ok_or(anyhow!("no matches found for core type: {:?}", core_type))?;
        let mirror = self.get_mirror().unwrap();
        let updater = Arc::new(
            instance::UpdaterBuilder::new()
                .set_client(self.client.clone())
                .set_nyanpasu_client(nyanpasu)
                .set_core_type(*core_type)
                .set_mirror(mirror)
                .set_artifact(artifact)
                .set_tag(tag)
                .build()
                .await?,
        );
        let updater_ref = updater.clone();
        let updater_id = updater.get_updater_id();
        self.instances.insert(updater_id, updater);
        tokio::spawn(async move {
            updater_ref.start().await;
        });

View on GitHub (pinned to f7dbce2997)