On this page
What context deadline exceeded means
Xray, sing-box and v2ray are written in Go, and this is how Go reports a timeout: an operation had a time limit (connecting to the server, the TLS handshake, a test request) and the limit ran out. v2rayN and v2rayNG show it in a delay test or in the log; clients built on sing-box, such as Hiddify and NekoBox, in their logs.
So the phrase alone says just one thing: the server didn't answer in time. Why, the rest of the line tells you. Xray writes long chains joined by >, from the general to the specific, for example failed to process outbound traffic, failed to find an available destination, failed to dial. Read to the end: the last part, such as dial tcp 203.0.113.5:443: i/o timeout, is the cause.
Each error in plain words
i/o timeout— the client asked to connect and nothing came back. The server is off, the address or port is wrong, a firewall drops the packets, or the network doesn't let them through.connection refused— the server answered, but nothing listens on that port: the VPN service isn't running, or the port in the link is wrong.connection reset by peer— the connection opened and was then torn down (on Windows:An existing connection was forcibly closed by the remote host). The server didn't accept the settings, or equipment on the way recognized the protocol.EOF— the other side closed the connection without a word. Most often the server didn't recognize the client: a wrong UUID or password, a different flow, transport or path.tls: handshake failure— the secure handshake didn't agree: the server has no certificate for the link's sni, or the link asks for TLS where the server has none.x509: certificate has expired or is not yet valid— the certificate looks out of date. Usually it isn't: the device's clock is wrong.timeout: no recent network activity— the QUIC error of Hysteria2 and TUIC: UDP packets stopped coming back.no such host— the server's name doesn't turn into an address: a typo, a domain that no longer exists, or DNS that doesn't answer.
What you see, why, and what to do
context deadline exceededon its own, the delay test failsCauseThe server didn't answer in time; the cause is in the lines around it
What to doRead the full log; check the port with the commands below
i/o timeoutCauseThe server is off, the address or port is wrong, or the packets are dropped on the way
What to doCheck the port; if it doesn't open, try another network, mobile data for example
connection refusedCauseThe server is reachable, but nothing listens on the port
What to doStart the VPN service on the server; compare the port in the link with its settings
connection reset by peer,forcibly closed by the remote hostCauseThe server rejects the settings, or the network breaks the connection
What to doCompare the link with the server; if it's right, move to a disguised protocol such as VLESS Reality
EOFCauseThe server didn't recognize the client: UUID, password, flow, transport or path
What to doGet a fresh link; read the server's log
tls: handshake failureCauseTLS doesn't match: the sni, the security setting or the port
What to doCheck
security,sniand the port in the link; for Reality, turn TLS fragmentation offx509: certificate has expired or is not yet valid, or VMess fails quietlyCauseThe device's clock is wrong
What to doTurn on automatic date and time, then reconnect
timeout: no recent network activityon Hysteria2 or TUICCauseUDP doesn't pass on this network, or the server's UDP port is closed
What to doOpen the UDP port on the server, or use a protocol over TCP
Check that the server's port opens
Take the address and port from the link: in vless://id@203.0.113.5:443?... they are 203.0.113.5 and 443. Run the check with the VPN off. These commands test TCP (VLESS, VMess, Trojan, Shadowsocks); a UDP port (WireGuard, Hysteria2, TUIC) can't be checked this way.
Test-NetConnection 203.0.113.5 -Port 443Look at TcpTestSucceeded: True — the port opens from here, False — it doesn't. A server name instead of the address works too.
nc -vz -w 5 203.0.113.5 443succeeded — the port opens. Connection refused — the server is there, but nothing listens on the port. No answer within 5 seconds — the packets don't reach it.
nslookup vpn.example.comFor a server given by name: an address in the answer means the name works, can't find means it doesn't resolve.
- The port opens, but the client still fails — the server is alive; the protocol's settings are wrong or the network recognizes the protocol.
- It opens from another network only (mobile data, a friend's Wi-Fi) — your network doesn't let it through. Change the protocol.
- It opens from nowhere — the server: the service stopped, the firewall is closed or the server is down. If it is yours,
journalctl -u xray -n 50 --no-pagershows what it made of the connection.
Check the clock
A certificate is valid between two dates, and with a clock that is days off, the client decides it has expired. VMess is stricter: the client's and the server's time may differ by no more than 90 seconds, or the server quietly drops the connection. What counts is the real time, so a clock set by hand to the right hours in the wrong time zone is wrong too.
On Android: Settings → System → Date & time → Set time automatically (the path differs a little from phone to phone).
w32tm /stripchart /computer:time.windows.com /samples:3 /dataonlyEach line shows the offset from an exact clock, such as +00.0352412s. Seconds are fine, minutes or hours are the problem. Fix it in Settings → Time & language → Date & time → Set time automatically.
sntp time.apple.comThe first number is the offset in seconds. Fix it in System Settings → General → Date & Time.
timedatectlSystem clock synchronized: yes — the time is synced. no — turn syncing on with sudo timedatectl set-ntp true.