Check the logs first: did the UI or the core exit?
Note the time of one launch attempt, then reproduce the issue just once. Clash clients typically run the graphical interface and proxy core as separate processes. After the window disappears, check the system tray or menu bar, then Task Manager or Activity Monitor. If the UI process is still running, the app may simply have minimized to the tray. If the UI has exited but the core is still running, check the UI crash logs first. Before reopening the client, make sure no leftover processes are running; otherwise, a second launch may trigger a new port conflict.
- If the UI is still open: Check the client’s Logs page and locate entries by launch time. Note the UI and core versions separately. Messages such as
core exitedonly indicate that the core exited; look earlier for the first error mentioning a filename, port, or system error code. - If a Windows window disappears immediately: Press Win + R, run
eventvwr.msc, and open Windows Logs → Application. Find an error event from the same time and check the faulting application, faulting module, and exception code. The module name can point you in the right direction, but it doesn’t identify the root cause on its own. - If a macOS window disappears immediately: Open Console from Applications → Utilities and check the Crash Reports section in the sidebar. Search by process name and time. You can also use Finder’s Go → Go to Folder to open
~/Library/Logs/DiagnosticReports/and find the relevant.ipsreport.
Client log locations vary. If the previous version still opens, use its Open Logs Folder or Open Config Folder option to find the path. If neither is available, check the client’s documentation. No core error in the system event logs doesn’t necessarily mean the core is healthy: a failed config validation can cause the app to exit normally without generating a crash report.
Port conflicts: check the listening address, port, and process
If the logs show bind: address already in use or Windows socket error 10048, note the address and port in the error. For example, 127.0.0.1:7890 may be the mixed-port listener. If the error points to 127.0.0.1:9090, check whether it belongs to external-controller. These ports are examples, not defaults for every client.
| System | Command to check TCP port 7890 | View results |
|---|---|---|
| Windows PowerShell | Get-NetTCPConnection -LocalPort 7890 -State Listen | Note LocalAddress and OwningProcess, then look up the process by PID in Task Manager’s Details tab. |
| macOS | lsof -nP -iTCP:7890 -sTCP:LISTEN | Check COMMAND, PID, and the listening address. |
| Linux | ss -ltnp 'sport = :7890' | Check the local address and process details. Without sufficient permissions, you may not see the names of processes owned by other users. |
- Replace the example port with the one shown in the logs. These commands check TCP listeners. If the error specifically says
listen udp, check UDP instead—for example, runGet-NetUDPEndpoint -LocalPort 1053in PowerShell. Replace1053with the actual port as well. - If an older client is using the port, exit it normally from the system tray first. If a service relaunches the process, stop the old instance through that client’s service management option, then check the listener again. Don’t terminate a process by PID until you’ve confirmed which app it belongs to.
- If the process using the port needs to keep running, change the port on one side of the conflict. For example, if
17890is available, changemixed-portto17890and update the system proxy and any apps that still use the old port. If the controller port is in conflict, change the controller setting—not the mixed port.
If no listener is found and the error indicates a permissions issue, don’t keep trying different ports. On Windows, error 10013 may indicate an access restriction or a reserved system port. Check the IPv4 TCP excluded port ranges with netsh interface ipv4 show excludedportrange protocol=tcp. If the port falls within one of these ranges, choose an available port outside it; don’t remove system reservations.
Corrupt config: test the YAML the core actually loads
For errors like yaml: line 23: did not find expected key, first identify which file line 23 refers to. The original subscription, the client’s override file, and the merged runtime config passed to the core may all be different files. Use the path recorded in the startup logs. Check the reported line as well as the indentation, quotes, and list items above it—the parser may not detect the problem until the next line.
Distinguish syntax errors from field errors
- Syntax errors: Use spaces for indentation and align items at the same level. Check that list items have a
-, string quotes are closed, and there’s a space after each key-value separator. If the file starts with<html>, it may be a login page or server error page—not a config the core can load. - Field or reference errors: Check that the current core supports each field in the config. Make sure policy references in
proxy-groupsandrulesmatch the names that are defined. Older Clash versions and mihomo don’t support exactly the same fields and protocols. Don’t delete unfamiliar fields just to make validation pass. - Path or resource errors: If the logs say a rule set, local proxy provider file, or geodata file can’t be read, check the core’s working directory, the file path, and read permissions for the account running it. If you test a copy of the runtime config in another directory, relative paths may point to different files.
If the client bundles mihomo and the same binary’s -h output lists -t and -f, you can test a copy of the config in a terminal. The example assumes the binary and config copy are in the current directory. In Windows PowerShell, replace ./mihomo with the corresponding .\mihomo.exe. If the config uses relative resources, also reproduce the working directory and data directory from the client’s actual launch arguments.
./mihomo -t -f ./config-check.yaml
A successful test means the core accepted this config; it doesn’t guarantee that the port can be bound or the TUN service will work. If the client generates the config by merging files, update the source subscription or override settings, then validate the newly generated file. Changes to a temporary runtime file are usually overwritten on the next launch. For field and rule syntax, see the rule syntax reference in the configuration guide.
Stale config data: isolate upgrade issues with a clean profile
If the client exits on its first launch after an upgrade and the same issue persists after reinstalling that version, first check whether user data is involved. Uninstalling the app usually doesn’t remove all user data. The last-used subscription, override scripts, automatic TUN settings, or old cache may load again when the new UI starts.
- Exit the client and make a backup first. Close the UI, quit from the system tray, and stop any old service instance for that client. Check the official documentation for the current version’s user data directory and back it up. Portable versions may store data beside the app. Don’t delete data for other Clash clients based on a generic folder name.
- Start with a clean profile. Fully exit the app, then temporarily rename the confirmed user data directory so the client creates a fresh one. On first launch, don’t import a subscription or enable the system proxy or TUN. If the system proxy still points to a local port that is no longer active, restore or disable that proxy setting to keep browser connection errors from confusing the diagnosis.
- Restore items one at a time. If the client works with a clean profile, import a known-good config first and restart to test it. Then restore overrides, rule providers, and feature settings in separate batches. Restore only one category at a time, and note what you added when the issue returns. Don’t copy the entire backup over the new profile.
- Keep a way to roll back. If the client still crashes with a clean profile, move the new directory aside and restore the backup under its original name. At that point, check the app architecture, system dependencies, or service logs instead of continuing to delete config data.
Permissions and system components: test basic proxy mode and TUN separately
If the client won’t open even with a clean profile and system logs show that an executable failed to load, check the OS version, CPU architecture, and installer requirements. Check both the UI installer and the core the client actually runs. On Linux, Exec format error commonly indicates a binary architecture mismatch. On Windows, if a specific UI version explicitly reports that WebView2 can’t start, install or repair the Microsoft Edge WebView2 Runtime as described in that version’s documentation. Not every Clash client depends on it.
- If a normal launch reports “Access denied”: Read the path in the error exactly and determine whether the core can’t execute, the user directory can’t be written to, or the config file can’t be read. Move app data to a supported location that the current user can write to. Don’t grant write access to the entire installation directory.
- If the client starts with TUN off but exits when it’s enabled: The basic config is able to start, so focus on the elevated service, virtual adapter, or device permissions required by that client. On Windows, check the status of the service specified in the client’s documentation using the Services window (
services.msc). On Linux, if/dev/net/tunis unavailable, determine whether the device is missing or the account running the app lacks access. Follow the client’s deployment documentation; running the UI as administrator indefinitely isn’t a fix. - If the system blocks the binary from launching: Check system alerts, crash logs, or security software quarantine records to identify whether the blocked file is the UI, core, or a helper process. Get the matching installer from a trusted release channel. On managed devices, follow your organization’s policy instead of disabling system protections to bypass the warning.
Verify recovery in this order
- Exit the client and launch it again. Make sure the UI stays open, the core logs show no repeated errors, and the local listening port matches the runtime config.
- Test the local proxy before enabling the system proxy. If apps configured to use the local proxy can connect but the browser fails after you enable the system proxy, check the address and port configured in the system proxy settings first.
- Enable TUN last, then restart once more. If the issue only appears with TUN enabled, note the first error before and after toggling it. Troubleshoot the service or device permissions separately; don’t reset YAML that you’ve already verified works.
If you still need to report the issue, include the OS version and architecture, client and core versions, whether you tested with a clean profile, and the first error. Specify whether it occurs when the UI starts, reads the config, binds a port, or enables TUN. That’s more useful for reproduction than simply saying the app crashes on launch.