libnyanpasu/clash-nyanpasu · warning

proxy selection succeeded; connection interruption error: {:

Error message

proxy selection succeeded; connection interruption error: {:?}; cache refresh error: {:?}

What it means

Thrown by the proxies `select` method after the proxy selection itself succeeded, when one or both of the follow-up side effects fail: interrupting existing connections and refreshing the proxy cache/delay snapshot. Since selection was already applied, the error reports both follow-up errors together instead of implying the selection failed. It is a partial-success condition: the group's selected proxy is changed, but post-selection cleanup may not have happened.

Source

Thrown at backend/tauri/src/core/proxies.rs:182

        actor: &ActorRef<Message>,
        group: String,
        name: String,
        interrupt: bool,
    ) -> Result<()> {
        self.clear();
        let api = self.core.api_client().await?;
        api.select_proxy(&group.into(), &name.into()).await?;
        let interruption = if interrupt {
            api.close_all_connections()
                .await
                .map_err(anyhow::Error::from)
        } else {
            Ok(())
        };
        let refresh = self.refresh(actor, api).await;
        match (interruption, refresh) {
            (Ok(()), Ok(_)) => Ok(()),
            (interrupt, refresh) => anyhow::bail!(
                "proxy selection succeeded; connection interruption error: {:?}; cache refresh error: {:?}",
                interrupt.err(),
                refresh.err()
            ),
        }
    }
}

impl Actor for ProxiesActor {
    type Msg = Message;
    type State = State;
    type Arguments = Args;
    async fn pre_start(
        &self,
        _: ActorRef<Message>,
        args: Args,
    ) -> Result<State, ActorProcessingErr> {
        Ok(State {

View on GitHub (pinned to f7dbce2997)

Solutions

  1. Treat selection as applied: call `get`/refresh again to verify the current proxy snapshot rather than blindly re-selecting.
  2. Retry only the refresh step (e.g. call the refresh/read operation) to repopulate the cache; do not replay the selection mutation automatically.
  3. Check the external controller (core API) connectivity and core health if refresh keeps failing; restart the core if its API is unresponsive.

Example fix

// before: assuming total failure and re-selecting
client.select_proxy(group, name).await?; // may re-fire side effects

// after: selection succeeded; verify state and refresh only
if let Err(e) = client.select_proxy(group, name).await {
    if e.to_string().contains("proxy selection succeeded") {
        // refresh snapshot; do not replay the mutation
        client.get_proxies().await?;
    }
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Probe core API reachability before selecting to reduce follow-up failures
let snapshot = client.get_proxies().await?;
anyhow::ensure!(!snapshot.api.is_revoked(), "core API unavailable; fix core before selecting");

Try / catch

match client.select_proxy(group, name).await {
    Err(e) if e.to_string().contains("proxy selection succeeded") => {
        // selection applied; refresh/verify instead of re-selecting
        let _ = client.get_proxies().await?;
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling `ProxiesClient::select` (via `select` on the proxies service) where `select_proxy` on the core API succeeded, but the `interruption` step (closing active connections) and/or the `refresh` step (cache refresh via actor + API) returned `Err`.

Common situations: The mihomo/clash external controller API briefly dropped connections mid-operation; the proxy actor was busy or timed out during refresh; network blips cause connection-interruption calls to fail; the core is restarting while selection is applied.

Related errors


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