How to fix “Failed to connect after 3 attempts” in FiveM
This error means the FiveM client tried to reach the server three times and got no usable answer. Sometimes the problem is on the player's side, sometimes on the server. Here is how to tell which, and how to fix both.
What the error means
When you join, the FiveM client first asks the server for its details over HTTP on the game port, 30120 by default, and then connects to the game itself. If those first requests time out or are refused three times in a row, FiveM gives up and shows this error. Something between the player and the server's port is not answering.
Seeing “Failed to fetch server variables” or a CURL code such as 28 or 7? Read the guide to FiveM CURL errors. An HTTP code such as 502 or 503? Read the guide to “Failed handshake to server”.
Quick checks for players
- Check that the server is online. Look for it in the server list, or ask in the community's Discord whether others can join.
- Connect directly. Press F8 in FiveM and type
connect ip:portwith the address the server owner gives you. - Turn off your VPN or proxy. Some VPNs block or slow down the ports FiveM uses.
- Clear the FiveM cache. Close FiveM, open
%localappdata%\FiveM\FiveM.app\dataand delete thecache,server-cacheandserver-cache-privfolders. Keepgame-storage, or FiveM has to download game data again. - Try another network. Restart your router or use a mobile hotspot. If it works there, your ISP's route to the server is the problem.
- Check your firewall and antivirus. Security software sometimes blocks FiveM's connection.
Fixes for server owners
If several players see the error at the same time, the problem is almost always on the server side.
1. Make sure the server is listening
In server.cfg, the server should listen on TCP and UDP on the same port:
endpoint_add_tcp "0.0.0.0:30120" endpoint_add_udp "0.0.0.0:30120"
Check the console for errors after a start, and check that txAdmin shows the server as online.
2. Open the port in every firewall
Allow port 30120 for both TCP and UDP in the operating system's firewall and in any firewall your host provides. A missing TCP rule causes exactly this error, because the first step of joining uses TCP. On Linux with ufw:
sudo ufw allow 30120/tcp sudo ufw allow 30120/udp
3. Check the address players use
If you changed the port, or put the server behind a proxy or DDoS protection service, make sure players and the server list get the right address. Settings like sv_endpoints and sv_listingHostOverride must match an address players can actually reach.
4. Look for server hitches
An overloaded server thread can answer too slowly while players join. Watch the console for hitch warnings, especially right after a restart, and find the resource behind them with the built-in profiler (profiler record).
5. Check your DDoS filtering
Filtering in front of your server has to allow FiveM traffic on both TCP and UDP. If a rule drops the HTTP requests on your game port, players see this error even though the server is running.
Still stuck?
Note the time of the error, the player's IP address and a screenshot. With those, your host can check its logs and see exactly 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.
