Most FiveM server errors come from a small set of causes: a resource that is missing, a start order that is wrong, or a value that does not match what the script expects. This guide covers the seven errors that stop servers during setup, what each one means, and the exact steps to clear it.

How to read a FiveM error first

Before fixing anything, learn to read the line. A console error carries four useful parts.

  • A timestamp, so you can match it against other errors in the same second.
  • A resource name, so you know which script to open.
  • A file and line number, so you know where inside that script to look.
  • A message, so you know what the code expected and did not get.

Read the first error, not the last. One failed resource can trigger five more complaints from scripts that depended on it. Fixing the bottom error on the list usually changes nothing, because the real problem was three lines above it.

The seven errors

1. Couldn't start resource

This means a resource failed to load. The console line directly after the error usually names the reason, and the most common reason is a missing dependency.

The fix has three steps. Read the line after the error and note which resource is named. Install or start that resource. Then confirm the dependency appears in the failing resource's fxmanifest.lua, and start it earlier in server.cfg.

-- fxmanifest.lua

fx_version 'cerulean'

game 'gta5'

dependencies {

'ox_lib',

'oxmysql',

}

If the manifest lists no dependencies at all, and the script still fails, check that the folder name matches the resource name. A folder renamed to something like qb-phone-main will not start as qb-phone.

2. Start order problems

A framework must start before the scripts that call it. If a job script loads before qb-core, its calls to the framework return nothing, and it either errors out or starts in a broken state.

Order in server.cfg is the fix: database layer first, then the library, then the framework, then scripts that build on it.

# database and library first

ensure oxmysql

ensure ox_lib

# framework next

ensure qb-core

# then your scripts

ensure qb-garages

ensure qb-phone

Keep related scripts together in the file and add a comment above each block. When you install something new months later, that comment tells you where it belongs.

3. oxmysql connection errors

When oxmysql cannot reach the database, every script that saves or loads data fails, often with errors that look unrelated. The cause is almost always the connection string or the database service.

Check each part of the string: the user, the password, the host, the port and the database name. A wrong port is common, and so is a database name that differs from the one you created.

# user, password, host, port, database name

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

Special characters in the password need URL encoding. A password containing @, : or ? breaks the string unless you encode it, so the simplest fix is a long password with letters and numbers only.

Then check the database itself. If the MySQL service is not running, or the port is blocked, no connection string will work. Start the service, confirm it is listening, and restart the server.

4. No such export

This error means a script called an export that does not exist at that moment. Three causes cover most cases: the resource providing the export is not installed, it is not started yet, or the export name or version is different.

Confirm the resource is running with ensure in the console and watch for a start error. Check the export name against that resource's own documentation, letter for letter. Then check the start order, because an export cannot be called before its resource loads.

A short burst of these errors at boot is usually an order problem. A steady stream during play is usually a resource that crashed after loading.

5. A script error with a line number

The console gives you a file and a line. Open that file at that line. Do not guess from the message alone.

The most common causes are a missing comma in a table, a missing end, a nil value where a table was expected, or a typo in a variable name. The line in the error is where Lua noticed the problem, which is sometimes one line below the real mistake.

local items = {

['water'] = { label = 'Water', weight = 500 } -- missing comma at the end of this line

['bread'] = { label = 'Bread', weight = 200 } -- the error is reported here

}

Read the surrounding lines, not just the one in the message. Change one thing, save, restart the resource, and read the console again. Do not change five things at once, or you will not know which one fixed it.

6. Game build mismatch

Some maps and scripts need content that only exists in a newer game build. If the server enforces an older build, that content is missing and the resource errors or the player sees broken assets.

Set the build in server.cfg to the one the content requires, then restart and test.

# example build - use the one your content needs

sv_enforceGameBuild 3095

Players don't need to do anything: FiveM switches to the build the server enforces by itself, so the first join after a change takes longer while it downloads. If a map crashes players on load, test it with the build its author specifies before you blame the map.

7. Server SCRIPT ERROR vs client F8 errors

The two consoles show different problems, and checking the wrong one wastes time.

Server-side SCRIPT ERROR lines appear in the server console, in your hosting panel, or in txAdmin. They come from server scripts: database calls, framework logic, exports, anything running with server.lua. Player-facing breakage that affects everyone is usually here.

Client errors appear in the F8 console in game. They come from client scripts and NUI: interfaces, targeting, blips, sounds, anything running on the player's machine. If one player reports a broken menu and others are fine, start with F8.

Read the first error in whichever console matches the symptom, and fix that one before reading further.

A short note on restarting

After a fix, restart the resource or the whole server before you judge the result. A cached script or an old config can make a correct fix look broken. If the error survives a clean restart, re-read the first line rather than the last.

Our server.cfg generator can build a clean starting file with resources in a sensible order, which takes care of the start-order problem above. The FiveM documentation at docs.fivem.net explains the server commands used here.

Quick checklist

  • Read the first error, not the last one in the console.
  • Check the resource named in the error is actually running.
  • Install and declare the missing dependency in fxmanifest.lua.
  • Fix start order: database, library, framework, then scripts.
  • Test the database connection string and confirm the service is up.
  • Restart cleanly, retest, and confirm the error is gone.