This guide provides solutions to frequently encountered problems when running a FiveM server.
Before fixing an error, determine where it is occurring:
server.log. These usually affect the entire server or specific resources starting up.F8 in-game). These usually affect a specific player or their UI/scripts.Logs are your primary tool for diagnosing issues.
txData/default/logs/ (or your specific profile folder).F8 console in-game. The log file is at %localappdata%\FiveM\FiveM.app\logs\CitizenFX.log.ERROR, EXCEPTION, warning, or stack trace.[script:resource_name] to identify the culprit.@qb-core/server/player.lua:164).The server cannot find your license key.
Solution:
sv_licenseKey "YOUR_KEY_HERE" to your server.cfg.Another program is using the server port (default 30120).
Solution:
sudo lsof -i :30120 then kill -9 <PID>server.cfg (endpoint_add_tcp and endpoint_add_udp) if you intend to run multiple servers.The server cannot verify ownership of a premium asset (Escrow system).
Solution:
sv_licenseKey used matches the account that owns the asset.The client cannot connect to FiveM’s authentication servers.
Solution:
A resource requires a specific identifier (Steam, Discord) that is not detected.
Solution:
sv_lan is set to 0 in server.cfg. LAN mode disables authentication identifiers.Usually a client-side cache or version mismatch issue.
Solution:
data/cache, data/server-cache, and data/storage in the FiveM Application Data folder.The script is trying to read a variable that doesn’t exist (is nil).
Solution:
config.lua.A script is trying to call a function from another resource that isn’t loaded or doesn’t exist.
Solution:
server.cfg.The server tries to start a resource defined in server.cfg but can’t find the folder.
Solution:
server.cfg vs the folder name (Case Sensitive on Linux!).fxmanifest.lua or __resource.lua.resources/cars/cars instead of resources/cars).The server cannot connect to the MySQL database.
Solution:
set mysql_connection_string in server.cfg.
server=localhost;uid=root;password=;database=fivemThe script needs a database table that hasn’t been created.
Solution:
.sql file provided with the resource into your database (using HeidiSQL or phpMyAdmin).Modern ESX Legacy replaced the event-based getSharedObject with an export, but older scripts still look for the event.
Solution:
@es_extended/imports.lua to the script’s shared_scripts in fxmanifest.lua.config.lua.Similar to ESX, scripts must use the correct export to load the core.
Solution:
local QBCore = exports['qb-core']:GetCoreObject()exports['qb-core']:GetSharedObject(). Update them to GetCoreObject.Usually happens when the player data is corrupted or the shared/jobs.lua file has syntax errors.
Solution:
qb-core/shared/jobs.lua for syntax errors (missing commas/brackets).README.md of every resource.my-script instead of My Script) to avoid Linux case-sensitivity issues.