Hello,
For several days now since our server was launched we keep getting HTTP 504 error after server restarts especially, some users reporting this error even while the server was not restarted.
We are experiencing this on two servers on the same host, using Debian 13 as the operating system. The main server runs on the default port, the development one runs on port 30121
both servers have „set sv_forceIndirectListing false”, we even tried setting that to true and didn’t help
the servers are using qb core as framework but a lot of custom scripts
it is hard to think this is something script related as this happens even before the fivem client reaching the server
the flow of the error is: you click from the browser list or recently connected to connect to the server, you get for a brief second „Fetching server info” and immediately you get HTTP Error 504 and stays like that even after multiple retries
eventually it gets fixed on its own but we also found a manual fix by going to „AppData\Local\FiveM\FiveM.app\data\nui-storage\IndexedDB\https_nui-game-internal_0.indexeddb.leveldb” and deleting the contents, specifically the ldb file
we use some iptable rules to accept tcp on ports 80, 443 only connections from cloudflare IPs and drop everything that isn’t from those IPs
we don’t have any rules the actual ports used by the server for them to be blocked
has anyone experienced such an issue and managed to find the cause?
30121 is the port for most game communications. If you have a server running on it, the other one might be trying to start up while that port is being used by the dev server. This is causing the conflict.
Thanks for the feedback, worth some additional tests.
Normally each server has defined their own ports, so it would be strange if they were conflicting on different ports or trying to start on different ports than the ones defined (which are different between the two servers).
We haven’t touched the ports, they stayed the same as they were up until now.
Did some linux tweaking as the conntrack table apparently got filled which might be an issue for dropping connections and not reaching the server to communicate. So far it seems to work, but need to see in time if it actually stays working or not.
Had something similar before. The 504 on “Fetching server info” usually points to the listing side, not your game ports, so the port conflict theory probably isn’t it if players eventually get in.
Few quick things to check:
-
netstat -tulpn right after restart to confirm nothing’s squatting on your ports
-
Check server.cfg for any stale sv_listingHostOverride or sv_listingIpOverride
-
Server console output right after restart, look for “failed to register” type messages
The fact that wiping the client IndexedDB fixes it points to clients caching a bad listing response, which is more of a Cfx-side thing than your config. If it’s always right after restart and clears up on its own, sounds like the listing service is just slow to pick the server back up and clients hit stale cache in the meantime.
Worth pinging it on the Cfx Discord too, might be a known listing issue