{"record":{"id":"623bdc406c6dce58","repo":"clash-verge-rev/clash-verge-rev","slug":"core-did-not-become-ready-after-start","errorCode":null,"errorMessage":"core did not become ready after start","messagePattern":"core did not become ready after start","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"src-tauri/src/core/manager/lifecycle.rs","lineNumber":158,"sourceCode":"    }\n    Ok(())\n}\n\nasync fn run_ready_core_start_transition<Start, StartFuture, Ready, Apply, ApplyFuture>(\n    start_core: Start,\n    core_is_ready: Ready,\n    apply_proxy: Apply,\n) -> Result<()>\nwhere\n    Start: FnOnce() -> StartFuture,\n    StartFuture: std::future::Future<Output = Result<()>>,\n    Ready: FnOnce() -> bool,\n    Apply: FnOnce() -> ApplyFuture,\n    ApplyFuture: std::future::Future<Output = Result<()>>,\n{\n    start_core().await?;\n    if !core_is_ready() {\n        anyhow::bail!(\"core did not become ready after start\");\n    }\n    apply_proxy().await\n}\n\nasync fn run_sidecar_termination_transition<Clear, ClearFuture, Terminate>(\n    clear_proxy: Clear,\n    terminate_sidecar: Terminate,\n) -> Result<()>\nwhere\n    Clear: FnOnce() -> ClearFuture,\n    ClearFuture: std::future::Future<Output = Result<()>>,\n    Terminate: FnOnce(),\n{\n    clear_proxy().await?;\n    terminate_sidecar();\n    Ok(())\n}\n","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/clash-verge-rev/clash-verge-rev/blob/5cad0f2799e74b1105e133bcfc2a45f5c1370ef1/src-tauri/src/core/manager/lifecycle.rs#L140-L176","documentation":"Thrown by run_core_start_transition after the start_core future succeeds but the core_is_ready predicate returns false. The core process was spawned but did not reach readiness (e.g. mihomo API not responding on external-controller, health probe failed) within the transition's expectations.","triggerScenarios":"start_core_inner returned Ok but the readiness check (typically an HTTP probe to the mihomo external-controller) still reports the core as not running; mihomo started but is stuck on initialization (port conflict, slow GeoIP download, bad config loaded after spawn).","commonSituations":"external-controller port is already taken by another instance; mihomo is downloading a large GeoIP/database file on first run; the API bind address is wrong (e.g. set to an interface that doesn't exist); startup raced ahead of readiness because the process forked but exited immediately after.","solutions":["Check that no other mihomo/proxy process is holding external-controller's port.","Inspect mihomo's stdout/stderr log for the startup error that prevented readiness.","Confirm `external-controller` and `secret` in the runtime config are reachable.","Increase startup patience or retry the start after clearing the conflicting process.","Validate the runtime config offline with `mihomo -t`."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt in 0..3 {\n    match run_core_start_transition(start, ready, apply).await {\n        Ok(_) => break,\n        Err(e) if e.to_string().contains(\"did not become ready\") && attempt < 2 => {\n            kill_orphan_on_port().await; continue;\n        }\n        Err(e) => return Err(e),\n    }\n}","preventionTips":["Free the external-controller port before starting the core.","Confirm `external-controller` / `secret` are correct in the runtime config.","Inspect mihomo stdout/stderr for the startup blocker.","Allow time for first-run GeoIP downloads before declaring not-ready."],"tags":["core","startup","readiness","lifecycle","mihomo"],"analyzedSha":"5cad0f2799e74b1105e133bcfc2a45f5c1370ef1","analyzedAt":"2026-08-12T03:25:57.699Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}