“Failed to fetch server variables” in FiveM: CURL error codes 28, 7, 6 and 56

“Failed to fetch server variables” is the first thing FiveM asks a server for, so it is where most join problems show up. The error ends with a CURL code, and that code tells you where the connection broke. Find your code in the table, then follow the checks for players or for server owners.

By the Nodewave team · Updated 8 November 2026

What the error means

When you join, FiveM first asks the server for its details over HTTP on the game port, 30120 by default. “Failed to fetch server variables” means that request did not work. The text after it, such as “Timed out” or “Couldn't connect to server”, and the CURL error code say how it failed. CURL is the networking library FiveM uses for these requests.

What each CURL error code means

CodeFiveM showsWhat it usually means
Code 28“Timed out” or “Timeout was reached”No answer came in time. A firewall drops the traffic, the IP or port is wrong, the server is frozen or offline, or the route is broken.
Code 7“Couldn't connect to server” or “Connection refused”The machine answered, but nothing accepts connections on that port: the server is stopped, listens on another port, or a firewall rejects the connection.
Code 6“Couldn't resolve host name”DNS failed. The domain is mistyped or has no record, or your own DNS can't look up the name.
Code 56“Recv failure: Connection was reset”The connection opened and was then cut: the server crashed, a firewall or DDoS filter reset it, or the network is unstable.
Code 35“SSL connect error”A secure connection failed, usually because of a wrong date and time or antivirus software that inspects HTTPS traffic.
Code 22“HTTP 502”, “HTTP 503” and other HTTP codesA web proxy or filter answered with an error instead of the server. See the guide to “Failed handshake to server”.

Not sure which one you have? Read the whole error line, not just the first words. If only one server fails and every other server joins fine, the problem is almost always on that server.

Quick checks for players

  1. Connect directly. Press F8 in FiveM and type connect ip:port with the address the server owner gives you. It works for some players when joining from the server list fails.
  2. Turn off your VPN or proxy. VPN addresses, and school or work networks, are often blocked and cause timeouts.
  3. Try another network. Use a phone hotspot. If it works there, your ISP, router or firewall is the cause.
  4. Remove old port forwarding. If you once hosted a FiveM server at home, delete leftover router rules for port 30120. They can swallow your own connections.
  5. Fix your DNS (code 6). Switch to 1.1.1.1 or 8.8.8.8, then run ipconfig /flushdns in a Windows command prompt.
  6. Check your date, time and antivirus (code 35). Set the clock to update automatically and allow FiveM in your security software.
  7. Clear the FiveM cache. Close FiveM and delete the cache, server-cache and server-cache-priv folders in %localappdata%\FiveM\FiveM.app\data. Keep game-storage.

Fixes for server owners

Test your server from outside first. On a computer on a different network, not on the server itself, run:

curl -m 10 http://YOUR_SERVER_IP:30120/info.json

If you get JSON back, players can reach the server, so look at the affected player's network or at a filter that blocks only them. A timeout is code 28, “Connection refused” is code 7, and anything else points to one of the fixes below.

Code 7: make sure the server is running and listening

Check that txAdmin shows the server online and that server.cfg listens on TCP and UDP:

endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

On Linux, confirm that something is listening on the port:

ss -tlnp | grep 30120

Code 28: open the port in every firewall

Allow port 30120 for TCP and for UDP in the operating system's firewall and in any firewall or panel your host provides. A missing TCP rule is enough to cause this error. On Ubuntu with ufw:

sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp

Code 6: check the domain

If players join with a domain, its A record must point to your server's IP. Don't turn on Cloudflare's orange-cloud proxy for it, because only web ports pass through and the game port fails. Set the record to “DNS only”.

Code 56: look for crashes and filters

Check the console and the txAdmin log around the time of the error for crashes and hitch warnings. If the server is healthy, a firewall or DDoS filter is resetting connections. Look at rate limits and blocklists, for example fail2ban rules that ban players who reconnect often.

Hosting at home?

A server on your own PC needs port 30120 forwarded for TCP and UDP to the PC's local address, and a public IP address. On a connection with carrier-grade NAT, which many mobile and some home connections use, forwarding can't work at all. A VPS has neither problem.

Run a current server build

Old FXServer builds cause connection errors that the current build already fixes. Update to the latest recommended build and restart.

Still stuck?

Note the full error text with its CURL code, the time, the player's IP address and the result of the curl test above. With those, your host can check its logs and see where the connection stopped.

Host your FiveM server in Singapore

Low ping for players in India, Malaysia and Indonesia, on AMD EPYC with NVMe and Gcore DDoS protection on every IP.

FiveM hosting in Singapore →