Understanding Xray Core Logs: Common Errors and How to Troubleshoot

Learn what Xray log messages like failed to dial, context canceled, invalid user, and TLS handshake mean. Set log levels and trace errors back to configuration issues.

In this article

For v2rayN and v2rayNG users dealing with node timeouts, pages that won't load, or repeated disconnects. First distinguish client messages from Xray core logs, then narrow down the issue in order: local listener, DNS, outbound connection, security handshake, and protocol authentication. The goal isn't to memorize errors, but to find the underlying cause in the same request and verify any change with a repeatable test.

Identify the log source first, then find where the request stalls

v2rayN is a graphical client; Xray is the core that actually handles proxy traffic. Subscription download failures, startup issues in the interface, and outbound proxy failures may appear in different logs. Seeing “Service started” only confirms that startup reached a certain point. It doesn't prove that node authentication succeeded or that the destination site is reachable.

Check the startup output for the core name and version, then confirm which core the current node actually uses. v2rayNG uses Xray; v2flyNG uses V2Fly, and their supported fields aren't interchangeable. For VLESS and REALITY issues in particular, check the core that's running—not just the client package version.

Local inbound Routing selects an outbound Resolve node address Connect and handshake Protocol authentication Access destination

This is a guide to the order of investigation, not a claim that every connection has six distinct stages. Some protocols combine authentication and the handshake, and the destination domain may be resolved on the server. When investigating an error, ask whether its address is the local listener, the node, or the final destination. The same port—443—can point to very different causes depending on where it appears.

10808
The local proxy port used in examples below; check your actual configuration
443
A common TLS port, but not proof that TLS is in use
5
Log level options, including none to disable output

Enable logging and capture a reproducible request

warning is usually enough for everyday use. To observe connection activity, start with info; switch briefly to debug if you need more detail. Xray's loglevel accepts debug, info, warning, error, and none. This controls error log verbosity; access logs are also affected by the access setting. Raising the log level won't fix a connection.

  1. Check the core

    In v2rayN, check the startup output under runtime information on the main screen. Note the name and version of the core actually launched. If there's no core startup entry, resolve the startup failure first rather than troubleshooting the remote node.

  2. Change the log level

    In v2rayN, go to “Settings” → “Parameter Settings,” find “Log level,” and set it to info. In v2rayNG, open the side menu and go to “Settings” → “Log level.” Menu groups and labels may vary by version. If you can't find the option, check the client version rather than applying settings for a different core.

  3. Reproduce the issue

    Save your changes and restart the proxy service to apply them. Close pages that refresh continuously, open one fixed test address, note when you do it, and keep about 10 seconds of logs from before and after that time.

  4. Restore the log level

    Once you find the cause, set the level back to warning. Before sharing logs, remove account identifiers, subscription URLs, node addresses, and visited domains. Keep the timestamps, protocol names, ports, and error chain intact.

If you use a custom Xray configuration, check the log snippet below. It's one configuration field, not a complete, runnable config. When the client generates the configuration, change the setting through the client; direct edits to temporary files may be overwritten on the next start.

{
  "log": {
    "loglevel": "info"
  }
}

failed to dial: trace the error chain to the actual failure

failed to dial means an attempt to dial or establish a connection failed; it's usually just a wrapper from a higher layer. The details that follow—such as lookup, connection refused, or i/o timeout—are more likely to reveal the cause. Read the full nested error before changing DNS, ports, or routing. Don't re-enter the UUID just because you see “dial.”

failed to dial

Cause: A general connection failure that may involve address resolution, a TCP connection, or transport encapsulation.

Fix: Read the nested error that follows and check the destination address and outbound tag. If you only captured these few words, retrieve the full log line first.

lookup ...: no such host

Cause: Resolution didn't return a usable address. Possible causes include a misspelled domain, an upstream response, or DNS routing—not necessarily DNS poisoning.

Fix: First identify whether the unresolved name belongs to the node or the destination. Then check whether the relevant DNS upstream is reachable and how the node domain is bootstrapped.

connect: connection refused

Cause: The connection was actively refused, often because nothing is listening on that port or the address or port is wrong. A device in between may also have sent the refusal.

Fix: Check the port in the subscription. For a self-hosted server, check its listening address and firewall too. Retrying the same configuration won't make an unopened port start listening.

i/o timeout

Cause: A network operation didn't complete before its deadline. Check the preceding logs to see whether it timed out during resolution, connection setup, or a read.

Fix: Keep the same node and configuration, then test again on a different network. If it times out on only one network, investigate that network path before changing node settings.

For example, if the error explicitly says a TCP connection to the node on port 443 timed out, there's not enough evidence yet to blame VLESS user authentication. Conversely, if the connection to the node succeeded but reading from the destination failed, checking only local connectivity to the node won't help. Always consider the address, stage, and timing together.

TLS handshake and invalid user: troubleshoot security and authentication separately

TLS handshake errors usually occur after a connection enters security negotiation, but that doesn't necessarily mean there's a certificate problem. For a standard TLS node, check serverName, the certificate chain, system time, and transport settings. For VLESS + REALITY, also check the public key, shortId, serverName, and server configuration. These are different setups; “disable verification” isn't a universal fix.

Log messageCheck firstDon't assume
TLS handshakeWhether the error chain also mentions EOF, a certificate error, or a timeout; whether the client's security type matches the serverThese two words alone don't prove that the certificate has expired
x509: certificate has expired or is not yet validClient date and time zone, certificate validity period, and server certificate deploymentDon't immediately enable certificate verification bypass
x509: certificate is valid forWhether the certificate domain listed later matches the serverName being verifiedA difference between the connection IP and certificate domain isn't necessarily a misconfiguration
invalid userLog source, protocol, user identifier, and the corresponding server-side user entryNot every client authentication failure displays this exact message
EOFWhen the peer closed the connection and whether the logs also show handshake, transport, or authentication detailsThis message alone doesn't prove the account is invalid

invalid user is more likely to provide a direct clue in server-side inbound authentication logs; the exact wording varies by protocol and version. The client may show only EOF or a closed connection. If you can access the server, align the two logs by time and check that the UUID matches, the user has been loaded, and the port maps to the expected inbound. For VMess, also check the system time; don't carry over VMess's alterId setting to VLESS.

context canceled: first check whether the request was simply canceled

context canceled means the context associated with an operation was canceled. Closing a tab, a browser opening a connection and then abandoning it, switching nodes, or restarting the core can all produce this message. It doesn't mean the node is necessarily down, and it doesn't by itself prove a DNS or certificate problem.

Why do I see context canceled when the page loads?

Stop refreshing, close extra tabs, and open a single page. If the cancellation appears after the page finishes loading or after you close it, with no ongoing failures, you usually don't need to change the node just because of this accompanying log entry.

A cancellation error appears as soon as I open a page. How do I find the cause?

Capture logs from the same time and correlate entries by request ID. If that version has no request ID, use the timestamp, destination address, and outbound tag. Look for a DNS failure, handshake error, or connection timeout before the cancellation.

Switching nodes produced a stream of cancellation errors. Do I need to reinstall?

Switching nodes terminates existing connections. Wait for the new core to finish starting, then make a fresh request. Analyze only entries from after the new startup time; cancellations from old connections don't tell you whether the new node works.

Should I check these logs for subscription update failures too?

Start by checking the subscription update result in the client. Core logs may help only if the update request actually went through the current proxy. If the request never reached the core, outbound logs won't show the subscription server's specific error.

Local ports and routing: confirm the request is actually reaching the proxy

If address already in use or Windows' Only one usage of each socket address appears right after the core starts, investigate a local listener conflict first. Make sure another client instance isn't still running, then check which process has the port open. If you change the proxy port, update the browser's manual proxy settings and the system proxy too—not just one setting in the client.

The example below uses local port 10808 on Windows. These commands only check which process is using the port; don't terminate another program's PID without confirming what it is. Ports aren't fixed defaults, so replace this with the port your configuration actually listens on.

netstat -ano | findstr :10808

If the port provides a SOCKS inbound, use the command below to send a test request explicitly through the proxy. On Windows, curl.exe avoids cases where the terminal treats curl as an alias. socks5h sends the destination domain to the proxy to resolve instead of resolving it locally with curl. If the inbound provides only an HTTP proxy, use the appropriate HTTP proxy option; don't copy the SOCKS command.

curl.exe --proxy socks5h://127.0.0.1:10808 --connect-timeout 10 --max-time 20 -I https://example.com/

Keep useful troubleshooting notes: change one variable at a time

Useful troubleshooting notes don't need thousands of log lines. The core version, time of failure, how the request was made, and one complete error chain are more helpful than “it won't connect.” If you change DNS, flow, port, and transport all at once, even a successful fix won't tell you what worked—and the next failure means starting over.

  1. Describe your setup: Operating system, client version, actual core version, and whether you're using the system proxy, an app's manual proxy, or TUN.
  2. State what should happen: For example, “The request should enter through SOCKS 10808, then reach the test address through the specified VLESS outbound”—not just “connected.”
  3. Keep the context: Include the startup completion entry, the time you made the request, and about 10 seconds of logs from before and after. Preserve the full nested error, not just its last line.
  4. Record each change: Change one setting per test round, restart, and repeat the same test. If it doesn't help, restore the original value before trying the next change.
  5. Wrap up: Restore the usual log level and confirm that both the browser and test command behave as expected. For more detailed basics, see the client setup guide.

The key to reading Xray logs is finding where the request fails: if the local listener isn't running, fix that first; if the node address won't resolve, investigate DNS; if TCP connects but the handshake fails, check security and transport settings; if the failure comes after authentication, look at access to the destination. Putting the error back into the request flow is more reliable than repeatedly tweaking settings based on one keyword.

Download clientv2rayN / v2rayNG