Clash Client Crashes on Launch: A Log-First Troubleshooting Checklist
App crashes right after opening? Check the startup log first to pinpoint the error type, then work through config syntax errors, port conflicts, corrupted cache folders, and missing runtime libraries. Includes log file locations for every platform.
A Clash client that opens and vanishes in a flash is one of the most confusing failure modes to troubleshoot — no error dialog, no time to react, not even time to grab a screenshot. But this behavior is almost never random; the root cause usually falls into one of four buckets: a config file syntax error, a port conflict that kills the process on startup, a corrupted cache or data directory, or a missing runtime library the client depends on. This guide walks through a check-the-log-first approach, covering how to pinpoint and fix each category, plus exact log file locations for every platform.
Before you reinstall, check the startup log
The knee-jerk reaction to a crash is to uninstall and reinstall — but if the real problem is a config file or a system-level issue, reinstalling won't help; it'll just crash again. The right first move is to find the last line written to the log before the crash. Nearly every Clash-based client (whether it's running on the Clash Premium core or the Clash Meta / mihomo core) writes an error stack trace or message to a local log file right before it dies — it just doesn't pop that up for you to see.
Once you've opened the log file, focus on two things: the last few lines at the end of the file, which usually point to the direct cause of the exit, and whether the same error keeps repeating. If the log shows the same error being appended over and over, the client is stuck in a launch-crash-retry loop, and that alone tells you a lot about what's going on.
If the log file is empty or was never created at all, chances are the client didn't even manage to start the core process. Suspect a missing runtime library or a corrupted installer before you start digging into your config.
Four common errors and how to fix them
1. Config file syntax errors
Clash's config file uses YAML, which is extremely picky about indentation and the space after colons. If the log shows something like yaml: line X: mapping values are not allowed in this context, cannot unmarshal, or similar, you're almost certainly looking at a parsing failure. Common culprits include:
- Using Tab characters for indentation instead of spaces (YAML doesn't allow tabs for indentation).
- Inconsistent indentation at the same nesting level — for example, 2 spaces under
proxies:on one line and 4 spaces on the next. - Full-width colons or curly quotes accidentally mixed into rules or proxy groups — nearly invisible to the eye, but the parser chokes on them instantly.
- A missing or extra
-list marker after manually editing a config generated from a subscription conversion.
To fix it, paste the config into any online YAML validator or a text editor with YAML syntax highlighting to locate the offending line, then compare that line's structure against the client's official example config. If the config came from a subscription conversion service, it's usually more reliable to regenerate a fresh subscription link from your provider's dashboard and re-run the update, rather than trying to hand-patch a file that's already broken.
2. Port conflicts causing an immediate exit
When Clash's core starts up, it needs to bind a mixed HTTP/SOCKS port (7890 by default) and a controller/dashboard port (commonly 9090). If either port is already taken by another process, the core fails to bind and exits immediately — the log typically shows bind: address already in use or listen tcp :7890: bind: permission denied. In GUI clients, this usually looks like the app flashing open and closing right away, since the front-end shuts itself down once it notices the core process has died.
To find the culprit, check which process is holding the port from a terminal: on Windows, run netstat -ano | findstr 7890 to get the PID, then end it in Task Manager; on macOS/Linux, run lsof -i :7890 to see the process name directly. Once you've identified the conflict, either close that process or change the mixed port in the client's settings — and remember to update the port in your system proxy settings too, or the proxy connection will just fail silently.
3. Corrupted cache or data directory
If the client gets force-killed on exit — say, the system went to sleep mid-write or the power cut out — the cache files, GeoIP database, or rule cache in the data directory can end up partially written. The next time the client tries to read that corrupted file, it crashes. The telltale sign in the log is that the error happens while reading cache or database files, not while parsing the config — look for keywords like database is locked, unexpected EOF, or invalid cache.
The fix is to fully quit the client (including any background tray process), then manually delete the cache subfolder in the data directory (usually named something like cache, *.db, or Cache) so it gets rebuilt on the next launch. Deleting the cache doesn't touch your config file or subscription links, so it's a safe move — the client will just re-download the GeoIP/GeoSite rule databases after restarting.
4. Missing system runtime libraries
Some platform builds rely on runtime libraries that need to already be installed on your system — the classic example is the Microsoft Visual C++ Redistributable on Windows, and GUI dependencies like GTK or WebKitGTK missing on some Linux distros. The telltale sign here is that no window ever appears at all — the process might not even show up in the process list, because it's failing at the dynamic-linking stage before any log directory even gets created.
Windows users can check whether the correct version of the VC++ Redistributable is installed under "Apps & features," and grab the latest version from Microsoft's official site if it's missing. Linux users can try launching the executable directly from a terminal — it'll print out the exact missing shared library (something like error while loading shared libraries: libwebkit2gtk...), which you can then install through your distro's package manager.
Log file locations by platform
Not being able to find the log file is one of the most common places people get stuck. The table below covers the typical log and data directory locations across major platforms (many clients also have an "Open log folder" shortcut buried in Settings — use that first if it's available, it's the easiest route).
| Platform | Typical log/data directory | How to find it |
|---|---|---|
| Windows | %APPDATA%\<client name>\logs | Paste %APPDATA% directly into the address bar, then sort by date modified to find the latest file |
| macOS | ~/Library/Logs/<client name> | Use "Go to Folder" in Finder and paste the path, or search the client's process name in Console.app |
| Linux | ~/.config/<client name>/logs | Run the executable directly from a terminal — errors print live to the terminal, which is faster than digging through files |
| Android | The "Logs" or "Runtime Log" menu inside the app | Most Android clients show logs right in the app — no root or file manager needed |
| iOS | The "Diagnostics" or "Logs" tab inside the app | iOS sandboxing blocks file export, so check the app's built-in diagnostics first if it crashes |
App names and folder naming can vary slightly between clients. If the paths above don't turn anything up, try searching your system's file search for the client's executable name plus .log — that usually finds it too.
A step-by-step troubleshooting checklist
Stringing all of the above into one repeatable process, here's the order to work through when the app crashes — this usually narrows things down within a few minutes:
- Fully quit the client (check the system tray/menu bar for any leftover process), reopen it, and note the exact moment the crash happens.
- Find the log file using the locations above and check the last error written — figure out whether it's a config parsing issue, a port binding issue, a cache read issue, or a runtime library load issue.
- If it's a config issue: temporarily switch back to an older config you know works, and check whether the client launches fine. If it does, the problem is confirmed to be in the new config.
- If it's a port conflict: use
netstat/lsofto find the process holding the port, then either close it or change the port — and update your system proxy settings to match. - If it's a corrupted cache: quit the client, manually clear out the cache subfolder, then relaunch and let it rebuild.
- If it's a missing runtime library: run the executable from a terminal to see the error, then install whatever dependency it's complaining about.
- Still crashing after all of the above: uninstall the client and delete the data directory too (not just the app itself), then download a fresh installer — this rules out a corrupted installer or leftover config as the cause.
Habits that prevent crashes from coming back
Once you've fixed a crash, a few small habits go a long way toward keeping it from happening again. Back up a working config before editing it — even just copying it to a differently named file — so you can roll back instantly if something breaks. Avoid opening the client right after a system update or a forced shutdown for anything important until you've confirmed it launches normally. Clean out rule caches and log files periodically so the data directory doesn't balloon and slow down startup. And if you regularly generate configs through a subscription conversion service, stick to the same template parameters as much as possible to avoid compatibility issues from field structures changing too often.
The core of dealing with a crash is: confirm the symptom, pin down the cause, then fix that specific thing. Blindly reinstalling or resetting your system proxy settings usually doesn't fix the underlying issue — and it wipes out the exact log evidence you'd need to diagnose it. Get in the habit of checking the log first, and most startup issues turn out to trace back to one of four things: the config file, a port, the cache, or a runtime library.
Download the Clash client
If your current client keeps hitting startup issues you can't pin down, head to the download page for the latest official installer, or follow the setup guide to rebuild your configuration from scratch.