Clash Subscription Import Error: How to Fix Parsing Failures
Fix Clash subscription import errors with checks for URL format, response content, YAML syntax, and server status.
First, tell download failures apart from parsing and configuration validation errors
Importing a Clash subscription involves several steps. The client requests the subscription URL, receives a response body, parses it as YAML or another supported format, then passes it to the core to validate proxies, proxy groups, and rules. The same “Import failed” message can point to very different stages. Open the client’s logs first, note when the error occurred and capture the first specific error message before making changes.
Interface labels in clients such as Clash Verge Rev can change between versions. Typically, add a remote subscription from the Subscriptions page by entering its URL and importing it; to refresh an existing subscription, use the menu on its card. Record both the client and core versions when troubleshooting—“latest version” isn’t specific enough. Older Clash cores, Clash Meta (now called mihomo), and other compatible implementations don’t support exactly the same configuration fields.
| Log message or symptom | Check first | Next step |
|---|---|---|
timeout, lookup, or TLS errors | Network, DNS, and certificates | Get a valid response before changing YAML |
| HTTP 401、403、404 | Authorization, URL, and server status | Check your account dashboard and subscription page |
Messages with a line number, such as yaml: line 12 | Response body and YAML syntax | Check the reported line and the few lines before it |
| Unsupported proxy type or missing proxy group reference | Core compatibility and configuration structure | Choose the matching format and test it with the core |
| Import succeeds, but no proxies appear | Subscription content, filters, and providers | Check whether the proxy sources actually loaded |
Step 1: Make sure you copied the subscription URL, not a webpage URL
In your provider’s dashboard, choose the subscription link specifically labeled for Clash, Clash Meta, or mihomo. An account login page, plan details page, or invitation link is not a subscription URL. Opening a page in a browser only confirms that the page is accessible; it doesn’t mean the core can read it as a configuration.
- Copy the full URL again. Check that it starts with
https://, hasn’t been cut off by a messaging app, and has no extra spaces, line breaks, or punctuation before or after it. Use the dashboard’s copy button if available. - Keep query parameters intact. Don’t remove parameters such as
tokenorkey, and don’t percent-encode the entire URL again. Use the parameter names exactly as they appear in the URL provided by your service. - Check for escaped characters. When copying from HTML source, a parameter separator may appear as the literal string
&. Multiple query parameters in a normal URL are typically separated by&. Copy the link again from its original source; don’t try to guess and bulk-replace parts of the token. - Check whether the URL was reset. Resetting a subscription token may immediately invalidate the old URL. Update the URL saved in the client instead of repeatedly clicking “Update” on the old entry.
A subscription URL can grant access to your account. Don’t paste it into a public online YAML validator, an unknown subscription converter, or a public support ticket. If you need to contact your provider, describe the error and when it occurred first, then share only the information needed through a private support channel.
Step 2: Check the HTTP status code and response body
To determine whether a subscription URL has expired, check both the status code and the response body. An HTTP 200 response may still contain a login page, an anti-bot page, or a JSON error message. And Content-Type: text/plain can still contain valid YAML. Don’t judge by the file extension, response headers, or a “download complete” message alone.
Save the response locally without automatically following redirects
If you’re comfortable using a terminal, run the following command in Bash. It hides the subscription URL as you enter it and saves the response headers and body separately in the current directory. First, switch to a working directory that only you can access. These files still contain sensitive information, so don’t upload them or sync them to a public repository. Windows users can use an environment with Bash or check the same details in the client logs.
umask 077
read -r -s -p 'Enter subscription URL: ' SUB_URL
printf '\n'
curl --connect-timeout 10 --max-time 30 \
--dump-header subscription-headers.txt \
--output subscription-body.txt \
--write-out 'HTTP %{http_code}\n' \
"$SUB_URL"
unset SUB_URL
The 10-second value is the connection timeout, and 30 seconds is the total request limit; neither is a measured performance result or a client default. The command doesn’t follow redirects automatically. For a 301, 302, 307, or 308 response, first check locally whether Location points to a domain your provider recognizes. The redirect target may also contain a token, so don’t share the response headers. Command-line requests may differ from those made by the client; use this only for comparison, not as proof that the client receives the same response.
Narrow down the issue by status code
- 200: Check the response body. If it starts with
<!DOCTYPE html>or<html, it’s usually a webpage, not a Clash configuration. - 204 or an empty body: There’s no content to parse. Check the URL and the server’s generation status; don’t try to hide the problem by adding a YAML field.
- 401 or 403: The token may be invalid, access may be restricted, or the request may be blocked by source restrictions or anti-abuse checks. The status code alone doesn’t prove that your account has expired.
- 404 or 410: Check whether the old endpoint has moved or been removed, then get an updated URL from your account dashboard.
- 429: Stop retrying repeatedly. If the response includes
Retry-After, wait as instructed. - 500, 502, 503, or 504: The subscription generation service or an upstream gateway may be having problems. Note the time and contact your provider.
If the response body starts with proxy links such as vmess:// or ss://, or contains a long Base64 string, you may have selected a generic subscription format. Whether the client can import it directly depends on the client; it isn’t a complete Clash YAML configuration. Choose the format intended for your client from your provider’s options.
Step 3: Check YAML indentation, field types, and policy references
Once you’ve confirmed the response is YAML, check its syntax. YAML uses spaces for indentation; don’t use tabs. The line number in an error message is usually where the parser detected a problem, but the actual cause may be on the previous line—for example, an unclosed quote, a missing space after a colon, or a list item lost during copying.
Check the syntax first, then the configuration
- Indentation: Keep indentation consistent at each level; two spaces per level is common. List item markers (
-) must also be at the correct level. - Special characters: Quote names or passwords that contain characters such as a colon followed by a space or
#. If a single-quoted string contains a single quote, double it according to YAML syntax. - Field types:
proxiesis typically a list of proxies,proxy-groupsa list of groups, andrulesa list of rules. Valid YAML syntax doesn’t guarantee that the fields match what the core expects. - References: Every proxy and group referenced by a rule or policy group must exist, and names must match exactly. Don’t rename a proxy without updating its references.
The minimal direct-connection configuration below can help isolate parsing problems. Save it as a separate test file; don’t overwrite your active subscription. It contains no proxy nodes, so all traffic is handled directly. A successful test only confirms that the core accepts this basic configuration; it doesn’t mean the subscription or proxy connections are working again.
mixed-port: 7890
mode: rule
log-level: info
proxies: []
proxy-groups:
- name: DIRECT-TEST
type: select
proxies:
- DIRECT
rules:
- MATCH,DIRECT-TEST
The 7890 value is an example mixed port, not a universal client default. A port conflict usually affects core startup or listening, not whether a remote response turns into HTML. For a configuration-only test, you don’t need to switch the system proxy, enable TUN, or change DNS first.
Test with the core you actually use
If mihomo is already installed on your system, use the command below to check the saved configuration. Run the same core version used by your client; passing the test with a newer core doesn’t prove that an older one is compatible.
mihomo -v
mihomo -t -f ./profile.yaml
-t tests the configuration, and -f specifies the file. A full configuration that references remote providers may still fetch resources during initialization or validation. Use trusted configurations in a controlled environment. Test logs may also include proxy names or resource URLs, so don’t publish them unedited.
Step 4: Check the core format, providers, and client overrides
Even when both files are YAML, a full configuration is different from a proxy provider file. A file used for proxy-providers usually contains only a proxies list; it isn’t a complete runtime configuration and must be referenced by a provider in the main configuration. Conversely, importing a full subscription with proxy groups and rules into a field that accepts only a proxy list may fail.
- Check the target core. If your provider offers separate Clash and Clash Meta/mihomo links, choose the one that matches the core your client actually uses. If you see an unsupported proxy type or field, check compatibility first rather than deleting security or protocol settings.
- Check for secondary downloads. After the main configuration imports,
proxy-providersandrule-providersmay still need to fetch resources. Use the logs to identify the type of URL that failed and distinguish a main subscription error from a resource update error. - Check how providers are used. A policy group that uses a provider must reference the matching name through a supported field such as
use. A filter expression that excludes every proxy can also leave the group with no selectable proxies. - Rule out overrides. Create a new test entry without applying personal merge configurations, scripts, or extension overrides. If the raw subscription works but the final configuration fails, restore overrides one at a time to find the field that causes the problem.
Step 5: Check the network path and account status
If the logs show a connection timeout, DNS lookup failure, or TLS certificate error, troubleshoot the request itself. A browser may use a proxy extension, cached content, or an active login session; the client may use a different network path to update subscriptions. Different results don’t by themselves prove that a URL is genuine or fake.
- Compare direct access with an existing working proxy. If the client offers a proxy option for subscription downloads, test both routes and note the results. Don’t make subscription updates depend on a node that’s already down. If no connection is available, try the same request over a phone hotspot to compare.
- Check your system clock. A significantly incorrect date or time zone can interfere with certificate validation. Sync the clock instead of disabling TLS certificate checks to bypass the error.
- Check DNS and network sign-in. Hotel, campus, and public Wi-Fi networks may block requests until you sign in. Complete network authentication before retrying; seeing HTML isn’t a reason to immediately change the subscription format.
- Check your provider’s dashboard. Confirm the plan’s expiration date, data allowance, subscription reset history, and any maintenance notices. Providers handle exhausted data allowances differently; some may return an error, while others may leave the proxies available.
If the same URL returns the same 403 or error body across multiple networks and your dashboard shows an authorization problem, contacting your provider is usually more useful than reinstalling the client. If only one device is affected, compare its system clock, proxy settings, client request options, and core version first.
After recovery: a successful import doesn’t mean the proxies work
After fixing the issue, update the subscription once manually and confirm that the logs no longer show download or parsing errors. Then check the proxy count, policy group members, and provider update times before testing a proxy connection. A successful latency test only confirms that the specific test request worked; it doesn’t verify access to the websites you use every day.
- Keep a backup of a verified configuration and note the client and core versions used when it was restored.
- Make sure the repaired subscription is enabled, not an older configuration that’s still running.
- Restore the normal automatic update schedule to avoid triggering rate limits with repeated requests.
- Delete temporary response files from your device. If the full subscription URL was exposed, reset its token in your provider’s dashboard and update it on all your devices.
When reporting the issue, include the time it occurred, client version, core version, HTTP status code, first error message with sensitive details removed, and whether it happens on other networks. Never post the full subscription URL, original proxy passwords, or the complete response body in a public discussion. Check in this order—URL, response, syntax, core, then network and account—to identify the failing stage and decide whether to update the link, fix the configuration, or wait for the server to recover.