When txAdmin shows the server as “starting” and it never goes green, the cause is almost always one of ten things: a bad or reused license key, a port already in use, a wrong bind address, a database that refuses the connection, a mistyped mysql_connection_string, resources started in the wrong order, sv_licenseKey in the wrong file, old artifacts, a lost admin login, or file permissions on Linux. Each one prints a recognisable line in the txAdmin live console. Find that line, match it below, apply the fix, and restart.
Open the live console first (txAdmin sidebar, “Live Console”) and scroll to the first red line after the boot banner. Errors further down are usually consequences of that first one.
1. License key invalid or bound to another server
Console says something like:
[svadhesive] Server license key not found or invalid!
or, when the key is already in use elsewhere:
Could not authenticate server license key. Server key is already in use by another server.
Cause. The key in server.cfg is wrong, has extra spaces, was pasted with a line break, or is currently being used by another running server (a second txAdmin instance, an old VPS you forgot to stop, or a friend who copied your config).
Fix. Open the Cfx.re Portal, check the key, and paste it again as a single line:
sv_licenseKey "cfxk_XXXXXXXXXXXXXXXXXXXX_XXXXXX"
If the key is in use elsewhere, stop the other server or generate a new key. Keys are cheap; time spent debugging is not.
2. Port 30120 or 40120 already in use
Console says:
Could not bind on 0.0.0.0:30120
or txAdmin itself refuses to open with a message about port 40120 being unavailable.
Cause. Another process is holding the port. Usually it is a previous FXServer that did not exit cleanly, sometimes a second server on the same machine, occasionally another game or service.
Fix. Find and stop the process.
Windows:
netstat -ano | findstr :30120
taskkill /PID <pid> /F
Linux:
sudo ss -tulpn | grep 30120
sudo kill <pid>
If you really need two servers on one machine, change the endpoints in the second server.cfg:
endpoint_add_tcp "0.0.0.0:30121"
endpoint_add_udp "0.0.0.0:30121"
and start the second txAdmin with a different port, for example +set txAdminPort 40121.
3. Bind address set to 127.0.0.1
Console says nothing alarming. The server starts, txAdmin turns green, and nobody outside your machine can connect. Direct connect times out.
Cause. server.cfg has:
endpoint_add_tcp "127.0.0.1:30120"
endpoint_add_udp "127.0.0.1:30120"
which only listens on the loopback interface. Some hosting panels also inject this to prevent public exposure until you configure it.
Fix. Change both lines to 0.0.0.0:30120 and make sure the port is forwarded on your router or allowed in the VPS firewall (ufw allow 30120/tcp and ufw allow 30120/udp on Ubuntu).
4. oxmysql missing or database connection refused
Console says:
[oxmysql] Unable to establish a connection to the database (ECONNREFUSED)!
or:
[oxmysql] Access denied for user 'root'@'localhost' (using password: YES)
Cause. The first means MariaDB or MySQL is not running, or is listening on a different host or port. The second means the user or password in your connection string is wrong. If you do not see any [oxmysql] line at all and framework resources complain about MySQL being nil, oxmysql is not in server.cfg or is started too late.
Fix. Check the database service is up (systemctl status mariadb on Linux, the Services panel on Windows, or the XAMPP control panel). Log in with the same credentials from a terminal: mysql -u fivem -p. If that fails, the problem is the user, not FiveM. Then make sure ensure oxmysql is near the top of server.cfg, before the framework.
5. Wrong mysql_connection_string
Console says:
[oxmysql] Unknown database 'fivem'
or a connection error that names a host you do not recognise.
Cause. The connection string has a typo in the database name, the host, or the format. There are two accepted formats and mixing them breaks parsing.
Fix. Use one of these, adapted to your values:
set mysql_connection_string "mysql://fivem:password@localhost/fivem?charset=utf8mb4"
set mysql_connection_string "server=localhost;uid=fivem;password=password;database=fivem;charset=utf8mb4"
If your password contains @, : or /, use the second (semicolon) format or URL-encode the characters in the first. And put this line before ensure oxmysql, since the resource reads it on start.
6. Resources started in the wrong order
Console says:
SCRIPT ERROR: @qb-garages/server/main.lua:3: attempt to index a nil value (global 'lib')
or (global 'MySQL'), or (global 'QBCore'), or Couldn't find resource ox_lib.
Cause. The script ran before its dependency was loaded. ensure lines in server.cfg execute top to bottom, and a resource that declares dependency 'ox_lib' in its manifest will still fail if ox_lib is simply never ensured.
Fix. Order the top of server.cfg like this, and keep your own resources at the bottom:
ensure oxmysql
ensure ox_lib
ensure qb-core # or es_extended / qbx_core
ensure ox_inventory # if used
# framework resources
# your custom resources last
Also check the script’s fxmanifest.lua has shared_script '@ox_lib/init.lua' when it uses lib.; missing that line gives the same nil error even with the correct order.
7. sv_licenseKey in the wrong cfg file
Console says the same “license key not found” message as error 1, but you are sure the key is correct.
Cause. txAdmin deployments have server.cfg in txData/<profile>/, but a lot of tutorials put the key in a second file (config.cfg, permissions.cfg) or in the root server.cfg of a manual install. txAdmin only reads the cfg file configured in “Settings > FXServer > CFG File Path”.
Fix. Open txAdmin Settings, note the exact cfg path, and put sv_licenseKey in that file. Remove duplicate sv_licenseKey lines elsewhere; if two files set it, the last one loaded wins and that is rarely the one you edited.
8. Artifacts outdated
Console says things like:
This server artifact version is no longer supported
or resources fail with natives that “do not exist”, or clients get kicked with a version mismatch.
Cause. The FXServer build is too old. Cfx.re drops support for old artifacts, and the client updates automatically, so a server that ran fine last month can start refusing connections.
Fix. Download the latest recommended build from the artifacts page, stop the server, replace the artifact folder (alpine/ and run.sh on Linux, the whole folder on Windows) and start again. txData/ is separate from the artifacts, so your config and resources survive. Keep a copy of the old build until you have confirmed the new one works; occasionally a “latest” build has a regression and you want the previous recommended one.
9. Lost the txAdmin master admin login
Console says nothing. txAdmin opens at localhost:40120, and you cannot log in.
Cause. The master password was changed, the txData/admins.json file was replaced, or the server was set up by someone else.
Fix. Stop the server completely, then start FXServer once with the reset flag:
FXServer.exe --reset-admin
./run.sh --reset-admin
txAdmin prints a fresh PIN in the console; open the web panel, enter it, and you can reclaim the master account. If that flag is not available in your build, the fallback is editing txData/admins.json directly: stop the server, replace the password hash for your user with a new bcrypt hash, and start again. Verify the exact procedure against the txAdmin docs for your version, since this changed across releases.
10. Permission errors on Linux
Console says:
bash: ./run.sh: Permission denied
or FXServer starts and then fails writing to txData with EACCES.
Cause. The artifact files lost their execute bit (common after unzipping with the wrong tool or copying through Windows), or txData is owned by root while the server runs as another user.
Fix.
chmod +x run.sh alpine/opt/cfx-server/FXServer
sudo chown -R fivem:fivem /home/fivem/server
Run the server as the fivem user, not as root. Running as root works until the day a script writes somewhere it should not.
How to read the txAdmin live console faster
A few habits that cut debugging time in half:
- Find the first error, not the last. Scroll up to the boot banner and read down. The first red line is the cause; later ones are fallout.
- Search for
SCRIPT ERRORandCouldn't. Those two strings account for most resource failures. - Note the resource name in brackets.
[ script:qb-garages ]tells you which folder to open. - Use
refreshandensure <resource>from the console to restart one resource instead of the whole server while you test. - Check
txData/logs/when the console has scrolled past what you need. The server log file keeps everything.
Our fivem-basics skill includes the common error strings and what they mean, which helps if you are pasting console output into Cursor or Claude Code and want a straight answer.
How FiveAI finds this for you
Everything above is pattern matching: read the console, recognise the line, apply the known fix. That is what FiveAI does on your machine. It connects to txAdmin, reads the live console and the log files, checks the database connection with your actual mysql_connection_string, and tells you which of these ten (or something rarer) is happening, then offers the fix. You say “the server won’t start since the last restart” and it goes and looks, instead of you scrolling through 800 lines of boot output. It also runs locally, so your config, keys and database never leave the server.
Frequently asked questions
Why does txAdmin say the server started but nobody can connect?
The server process is running, but it is not reachable. Check error 3 (bind address 127.0.0.1) and your firewall or router forwarding for port 30120 TCP and UDP. Direct connect to 127.0.0.1:30120 from the same machine to confirm the server itself is fine.
How do I reset the txAdmin password?
Stop the server and start FXServer once with --reset-admin (see error 9). It prints a PIN you use to reclaim the master account. If your build does not support the flag, edit txData/admins.json and replace the password hash.
Do I need to reinstall txAdmin after updating artifacts?
No. txAdmin ships inside the artifacts and updates with them. Your profile lives in txData/, which you keep. Replace the artifact folder, start the server, and txAdmin picks up the existing profile.
Related FiveM skills
Add these skills to Cursor, VS Code or Claude Code so the AI knows the real APIs mentioned in this post.