Hysteria2: timeout: no recent network activity, causes and fixes

timeout: no recent network activity means that not a single packet came back from the server. The auth password, the certificate and the clock are not the cause: each of them gives its own text. Look at four things: whether the server runs and its UDP port is open (a rule for TCP 443 is not enough), whether the address and port are right, whether obfs matches on both sides, and whether your network lets UDP through. Try another network first: if it works there, yours drops UDP or QUIC, and port hopping, obfs or a protocol over TCP helps.

Updated

Link checker: every field and what's wrong with it

Hysteria2 in Veli: the link with everything in it. Veli takes hysteria2:// and hy2:// links, Clash / mihomo lists and sing-box JSON.

Download Veli for free
On this page

timeout: no recent network activity: what it says

Hysteria2 and TUIC run on QUIC, which is UDP. The line comes from the QUIC library, quic-go, so it looks the same in Hysteria's own client, sing-box, mihomo and every app built on them. UDP has no refusal of a connection: a closed port, a firewall and a wrong obfs password all look like silence.

When it appears says which silence it is. While connecting, the library waits 5 seconds for any answer. On a connection that was working, it gives up after 30 seconds without a packet from the server (Hysteria's default idle timeout, with a keepalive every 10 seconds).

What you see, why, and what to do

  • failed to initialize client with connect error: timeout: no recent network activity, on every network

    CauseThe server isn't running, its UDP port is closed, the address or port is wrong, or obfs doesn't match

    What to doThe server commands below; compare obfs on both sides

  • The same, but only on one network (office, hotel, one mobile operator)

    CauseThis network drops UDP or recognises QUIC

    What to doAnother port, port hopping, obfs, or a protocol over TCP

  • timeout: handshake did not complete in time

    CauseSome packets did come back, but the handshake didn't finish in 10 seconds: heavy loss, or large packets don't get through

    What to doAnother network or port; check that the VPN isn't running inside another VPN

  • connection closed: timeout: no recent network activity after it worked

    CauseNothing from the server for 30 seconds: the network changed, the device slept, or a long UDP flow is throttled

    What to doReconnect; port hopping; lower the bandwidth set in the client

  • authentication error, HTTP status code: 404 (Hysteria) or authentication failed, status code: 404 (sing-box)

    CauseUDP works, the server refused the password

    What to doCheck the password; with userpass it is written as user:password

  • CRYPTO_ERROR 0x12a (local): tls: failed to verify certificate: x509: certificate signed by unknown authority

    CauseThe server's certificate is self-signed

    What to doPin it with pinSHA256, add its CA, or get a real certificate

  • x509: certificate has expired or is not yet valid

    CauseThe certificate ran out, or the device's clock is wrong

    What to doTurn on automatic time; renew the certificate

  • CRYPTO_ERROR 0x178 (remote): tls: no application protocol

    CauseSomething answers QUIC on this port, but not your protocol: the ALPN differs

    What to doCheck the port; for TUIC compare alpn with the server

Find the side that is silent

  1. 1

    Change the network

    Connect from a phone's hotspot or from mobile data with the same link. Works there: your network is the cause. Fails everywhere: the server or the link.

  2. 2

    See whether QUIC passes at all

    With the VPN off, open https://www.cloudflare.com/cdn-cgi/trace in Chrome or Firefox and reload it once or twice. http=http/3 means UDP 443 isn't closed outright. http/2 every time hints that it is.

  3. 3

    Compare the link with the server

    The address, the port, obfs and obfs-password. A domain in the link should resolve to this server: nslookup vpn.example.com. If it also has an IPv6 address the server doesn't listen on, put the IPv4 address in the link.

  4. 4

    Open UDP, not just TCP

    The server's own firewall and the hosting provider's panel are two separate lists. A rule for port 443 made for a website is usually TCP only.

Check on the server

Run these over SSH on the server. The service name is the one Hysteria's own install script creates; put your port in place of 443.

Linux server: is it running
systemctl status hysteria-server.service
journalctl --no-pager -e -u hysteria-server.service

The first says whether the service is active, the second shows its last lines. A typo in the config or a busy port shows up here.

Linux server: is the UDP port open
sudo ss -ulnp | grep 443

-u is UDP: a line with your port and the program's name should be there. ss -tlnp shows TCP and tells you nothing about Hysteria2.

Linux server: do packets arrive
sudo tcpdump -ni any udp port 443

Connect from the client while it runs. No packets: they are lost before the server, in your network or in the provider's firewall. Packets come in and none go out: the server drops them, most often because of obfs. Both directions: the answers are lost on the way back.

Linux server: firewall
sudo ufw status
sudo ufw allow 443/udp

For a server with ufw. The provider's panel has its own firewall, and it needs the same UDP rule.

obfs and port hopping: the same on both sides

obfs scrambles every packet, so a server with obfs doesn't see a handshake in a packet without it, and the other way round. It doesn't answer either: Hysteria's documentation says that a wrong obfs password gives a timeout, just as if the server weren't running. The password must be at least 4 bytes long.

Port hopping helps when the network throttles one long UDP flow or blocks one port. The client picks a port from a range and moves to another every 30 seconds. On Linux the server can listen on a range by itself (listen: :20000-50000); older versions need a firewall rule that redirects the range to the server's port. The whole range has to be open for UDP. If the network blocks UDP as a whole, hopping won't help.

  • Hysteria config.yaml

    obfsobfs: type: salamander, password under salamander:

    Port rangeserver: example.com:443,20000-50000, hopInterval in transport

  • A hysteria2:// link

    obfsobfs=salamander&obfs-password=…

    Port range@example.com:443,20000-50000/ or mport=20000-50000

  • sing-box JSON

    obfsobfs: type and password

    Port rangeserver_ports, hop_interval

  • mihomo YAML

    obfsobfs, obfs-password

    Port rangeports, hop-interval

It connects, then drops every few minutes

  • Bandwidth set too high. With up and down in the config, Hysteria2 sends at that speed whatever the network says. More than your line carries means loss, then a timeout. Set what the line really gives, or remove both lines: the client then uses BBR.
  • A throttled flow. If the speed falls a few minutes in and the connection dies, turn on port hopping.
  • The network changed. Moving from Wi-Fi to mobile data leaves the client sending into the old network for up to 30 seconds before it gives up.
  • The phone saves battery. Keepalive goes out every 10 seconds only while the app is running. Remove battery limits for it.

If it still times out

  • The provider filters UDP. Some hosts limit inbound UDP or put DDoS protection in front of it. tcpdump on the server shows nothing while the client sends: ask support.
  • A very old kernel. Hysteria's documentation names CentOS 7 among the causes of this error. A current Linux doesn't have it.
  • An Ed25519 certificate. Recent Hysteria clients copy Chrome's QUIC, and Chrome doesn't accept Ed25519: the handshake fails. Use an ECDSA or RSA certificate, as Let's Encrypt issues.
  • The network simply doesn't carry UDP. Nothing on the server helps then. A protocol over TCP, such as VLESS with Reality, goes through the same network.

Sources

How we write and check

In Veli

Hysteria2 in Veli: the link with everything in it

Veli takes hysteria2:// and hy2:// links, Clash / mihomo lists and sing-box JSON. obfs with its password and a port range (after the port or in mport) are read from the link; without an interval in the link, the port changes every 30 seconds. Profiles tests a Hysteria2 server with a real request through it, not with a ping of the address: “blocked” means the address answers but traffic through the protocol doesn't go, “no answer” means silence.

If the server never answers, the app stops after about a minute and a half and says why; “What happened” opens the record in the log, with the lines of the protocol module. With “Fallback servers” on in Settings → Connection, after 3 failed attempts it moves to the fastest of the other profiles, so keep one over TCP there. Veli doesn't install Hysteria2 on your server: on a VPS it puts VLESS Reality, AmneziaWG, WireGuard, Shadowsocks, OpenVPN or Veli.

FAQ

What does no recent network activity mean in Hysteria2?

The client got no packet from the server: 5 seconds of silence while connecting, or 30 seconds on a working connection. The server is off, its UDP port is closed, obfs differs, or the network drops UDP.

Can a wrong Hysteria2 password cause this timeout?

The auth password can't: it gives an authentication error with HTTP status 404. A wrong obfs password can, because the server ignores such packets.

Port 443 is open, why does Hysteria2 still time out?

Check that it is open for UDP. Websites use TCP 443, and a rule made for a site usually covers only TCP.

Does port hopping fix the timeout?

It does when the network blocks or throttles a single port. When all UDP is blocked, only a protocol over TCP gets through.

Why does Hysteria2 work on Wi-Fi and not on mobile data?

The operator drops or squeezes UDP. Try another port, hopping or obfs, and keep a TCP profile such as VLESS Reality for that network.

A test that goes through Hysteria2 itself

Veli is a free client for Windows, macOS, Linux and Android. Profiles sends a request through each server, so a closed UDP port shows before you press Connect.