FiveM Updated April 27, 2026

Troubleshooting Common FiveM Server Errors

Diagnose and fix the most common FiveM server errors including license failures, resource crashes, and database connection issues.

FiveMTroubleshootingErrorsDebuggingSupport

Overview

Most FiveM server problems fall into a handful of categories: startup failures, resource errors, database connectivity, and player connectivity. This guide covers the most common errors with specific diagnostic steps and fixes.

Where to Find Logs

Location What it contains
txAdmin live console Real-time FXServer output; most errors appear here first
resources/[system]/[monitor]/monitor.log Persistent txAdmin log; survives restarts
Database error log MySQL/MariaDB errors (usually /var/log/mysql/error.log on Linux)
Panel console Container-level output; useful for startup failures before FXServer initializes

Always start by reading the txAdmin console. Most errors print a clear message with the resource name or file that failed.

License Key Errors

Error: License key not found or server exits immediately after startup.

Cause: sv_licenseKey is missing, incorrect, or the key was revoked.

Fix:

  1. Verify the key in server.cfg matches exactly what is shown at https://keymaster.fivem.net.
  2. Confirm the server's public IP matches the IP registered for the key in Keymaster.
  3. If the key was regenerated, update server.cfg (or the panel's SERVER_LICENSE_KEY variable) with the new key.
  4. Restart FXServer.

Resource Failed to Start

Error: [ResourceName] Resource failed to start or Error parsing script.

Cause: Syntax error in fxmanifest.lua or a Lua/JS/C# script file.

Fix:

  1. Look at the line immediately following the error in the txAdmin console — Lua errors print the filename and line number.
  2. Open the file and inspect the reported line for mismatched brackets, missing commas, or invalid strings.
  3. Common Lua pitfalls: using == for assignment instead of =, missing end for if/for blocks, unclosed string literals.
  4. Run start ResourceName in the txAdmin console to re-attempt starting the resource after fixing the file.

MySQL Connection Failed

Error: [oxmysql] Failed to connect to database or MySQL connection failed.

Cause: Incorrect connection string, MySQL not running, or missing user permissions.

Fix:

set mysql_connection_string "mysql://user:password@localhost/database?charset=utf8mb4"

Check each component:

  1. Verify MySQL/MariaDB is running: sudo systemctl status mariadb
  2. Test the credentials manually: mysql -u user -p database
  3. Confirm the user has GRANT ALL on the database
  4. If the password contains special characters (@, /, #), URL-encode them in the connection string
  5. On panel-hosted servers, use 127.0.0.1 instead of localhost if the connection is refused

Players Cannot Connect

Symptoms: Server appears in txAdmin as running but players get "Connection timed out" or "Couldn't connect to server".

Checklist:

  1. Confirm port 30120 is open for both TCP and UDP in the firewall
  2. Verify endpoint_add_tcp and endpoint_add_udp are both present in server.cfg
  3. Confirm the server is reachable: nc -zv SERVER_IP 30120
  4. Check that sv_licenseKey is valid — an invalid key can prevent cfx.re routing
  5. In the panel, verify port 30120 is allocated to this server instance

Error: attempt to call nil value on natives like GetAllVehicles after enabling OneSync.

Cause: Certain natives do not work as expected with OneSync's entity scope system.

Fix: Replace entity-enumeration natives with server-side tracking or use GetGamePool alternatives. Consult the resource author or community forums for OneSync-compatible versions of old scripts. As a temporary measure, onesync legacy may restore compatibility at the cost of performance.

Resource Dependency Order Errors

Error: attempt to index a nil value (global 'ESX') or QBCore is nil.

Cause: A dependent resource started before the framework finished initializing.

Fix: In server.cfg, ensure the framework resource appears before all resources that depend on it:

ensure oxmysql
ensure es_extended
# ESX-dependent resources below this line
ensure esx_vehicleshop

If the order is already correct, the dependent resource may not be waiting for the framework's ready event. Check the resource's README for initialization patterns.

Server Crashes or Restarts Unexpectedly

  1. Check the txAdmin Diagnostics page for crash dumps.
  2. Look for FATAL lines in the monitor log.
  3. Run resmon in the server console to check for resources with high CPU or memory usage — a single poorly-written resource polling every tick can destabilize the server.
  4. Disable recently added resources one at a time to isolate the cause.

txAdmin PIN Expired

Symptom: txAdmin shows a PIN screen but the PIN in the console is old or missing.

Fix: Restart FXServer. A new PIN is printed to the console each time FXServer starts before txAdmin setup is complete.