Common Errors & Solutions
This guide provides solutions to frequently encountered problems when running a FiveM server.
Error Categorization
Before fixing an error, determine where it is occurring:
- Server-Side Errors: Appear in your txAdmin console, server terminal, or
server.log. These usually affect the entire server or specific resources starting up. - Client-Side Errors: Appear in the player’s F8 Console (press
F8in-game). These usually affect a specific player or their UI/scripts.
Log Analysis Techniques
Logs are your primary tool for diagnosing issues.
Log Locations
- txAdmin:
txData/default/logs/(or your specific profile folder). - Server Console: The live output window where you started the server.
- Client Console: The
F8console in-game. The log file is at%localappdata%\FiveM\FiveM.app\logs\CitizenFX.log.
What to Look For
- Key Terms: Search logs for
ERROR,EXCEPTION,warning, orstack trace. - Resource Name: Look for
[script:resource_name]to identify the culprit. - Line Numbers: Errors often point to a specific file and line (e.g.,
@qb-core/server/player.lua:164).
Server Startup Errors
”GlobalError: This server does not have a license key specified”
The server cannot find your license key.
Solution:
- Get a key from FiveM Keymaster .
- Add
sv_licenseKey "YOUR_KEY_HERE"to yourserver.cfg. - Ensure the key matches your IP address.
”bind: address already in use”
Another program is using the server port (default 30120).
Solution:
- Check if another FiveM server instance is running.
- Kill the process occupying the port:
- Linux:
sudo lsof -i :30120thenkill -9 <PID> - Windows: Check Task Manager or Resource Monitor.
- Linux:
- Change the port in
server.cfg(endpoint_add_tcpandendpoint_add_udp) if you intend to run multiple servers.
”You lack the required entitlement to use <resource>”
The server cannot verify ownership of a premium asset (Escrow system).
Solution:
- Ensure the asset is in your Keymaster account.
- Ensure the
sv_licenseKeyused matches the account that owns the asset. - Restart the server to refresh the license cache.
Connection & Authentication Errors
”Couldn’t establish a game authentication session”
The client cannot connect to FiveM’s authentication servers.
Solution:
- Client: Restart FiveM and Steam/Discord.
- Server: Ensure the server has outbound internet access.
- General: Check status.cfx.re for platform-wide outages.
”Unable to find SteamID” / “Identifier missing”
A resource requires a specific identifier (Steam, Discord) that is not detected.
Solution:
- Steam: Ensure Steam is open and running before launching FiveM.
- Discord: Ensure the Discord desktop app is open.
- Server Owner: Verify
sv_lanis set to0inserver.cfg. LAN mode disables authentication identifiers.
”Stuck on ‘Analyzing Game Data’”
Usually a client-side cache or version mismatch issue.
Solution:
- Clear client cache: Delete
data/cache,data/server-cache, anddata/storagein the FiveM Application Data folder. - Verify GTA V game files via Steam/Epic/Rockstar launcher.
Resource & Script Errors
”SCRIPT ERROR: @resource/script.lua:10: attempt to index a nil value”
The script is trying to read a variable that doesn’t exist (is nil).
Solution:
- Check the line: Look at the code around the line number mentioned.
- Missing Config: Often caused by missing entries in
config.lua. - Invalid Data: A database query might have returned no results.
”No such export <name> in resource <resource>”
A script is trying to call a function from another resource that isn’t loaded or doesn’t exist.
Solution:
- Dependency Order: Ensure the resource providing the export starts before the resource using it in
server.cfg. - Typo: Check for spelling errors in the export name.
- Version: The resource might be outdated and the export name changed.
”Resource <name> does not exist”
The server tries to start a resource defined in server.cfg but can’t find the folder.
Solution:
- Check the spelling in
server.cfgvs the folder name (Case Sensitive on Linux!). - Ensure the folder contains an
fxmanifest.luaor__resource.lua. - Check for nested folders (e.g.,
resources/cars/carsinstead ofresources/cars).
Database Errors
”Connection refused” / “ECONNREFUSED”
The server cannot connect to the MySQL database.
Solution:
- Is MySQL Running?: Check XAMPP/MariaDB service status.
- Connection String: Verify
set mysql_connection_stringinserver.cfg.- Format:
server=localhost;uid=root;password=;database=fivem
- Format:
- Credentials: Ensure username and password are correct.
”Table ‘fivem.users’ doesn’t exist”
The script needs a database table that hasn’t been created.
Solution:
- Import the
.sqlfile provided with the resource into your database (using HeidiSQL or phpMyAdmin).
Framework-Specific Errors
ESX Framework
”No such export getSharedObject in resource es_extended”
Modern ESX Legacy replaced the event-based getSharedObject with an export, but older scripts still look for the event.
Solution:
- Update Script: Check if the script has a newer version supporting the export.
- Manifest Shim: Add
@es_extended/imports.luato the script’sshared_scriptsinfxmanifest.lua. - Enable Compatibility: Some versions of ESX allow enabling the old event in
config.lua.
QBCore Framework
”No such export GetCoreObject in resource qb-core”
Similar to ESX, scripts must use the correct export to load the core.
Solution:
- Ensure you are using:
local QBCore = exports['qb-core']:GetCoreObject() - Some older scripts might use
exports['qb-core']:GetSharedObject(). Update them toGetCoreObject.
”Attempt to index a nil value (field ‘Jobs’)”
Usually happens when the player data is corrupted or the shared/jobs.lua file has syntax errors.
Solution:
- Check
qb-core/shared/jobs.luafor syntax errors (missing commas/brackets). - Ensure the job exists in the shared configuration.
Prevention Strategies
- Regular Backups: Always backup your database and resources before adding new scripts.
- Read Documentation: Read the
README.mdof every resource. - Check Dependencies: Ensure all requirements listed in the resource’s documentation are installed and started.
- Naming Conventions: Use lowercase names for resources (e.g.,
my-scriptinstead ofMy Script) to avoid Linux case-sensitivity issues. - Keep Updated: Regularly update server artifacts and framework cores, but read changelogs first!