[HELP] Essential Mode / MySQL issues

Hi,

My server is on and working, some commands on EssentialMode work - but not /kick etc. It is writing to the user table (the only table I get when I import sql.sql) with the details

In the console, I get the following errors:

InvokeNative: execution failed: Argument at index 0 was null.
Error running call reference function for resource es_admin2: citizen:/scripting/lua/scheduler.lua:348: Execution of native 00000000406b4b20 in script host failed.
stack traceback:
[C]: in upvalue ‘_in’
citizen:/scripting/lua/natives_server.lua:141: in function ‘GetPlayerName’
server.lua:365: in upvalue ‘ref’
citizen:/scripting/lua/scheduler.lua:334: in function citizen:/scripting/lua/scheduler.lua:333
[C]: in function ‘xpcall’
citizen:/scripting/lua/scheduler.lua:333: in function citizen:/scripting/lua/scheduler.lua:332
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:348: in function citizen:/scripting/lua/scheduler.lua:319
Error running call reference function for resource essentialmode: citizen:/scripting/lua/scheduler.lua:348: citizen:/scripting/lua/MessagePack.lua:830: missing bytes
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/MessagePack.lua:830: in method ‘underflow’
citizen:/scripting/lua/MessagePack.lua:465: in field ‘any’
citizen:/scripting/lua/MessagePack.lua:860: in field ‘unpack’
citizen:/scripting/lua/scheduler.lua:560: in upvalue ‘callback’
server/main.lua:213: in upvalue ‘ref’
citizen:/scripting/lua/scheduler.lua:334: in function citizen:/scripting/lua/scheduler.lua:333
[C]: in function ‘xpcall’
citizen:/scripting/lua/scheduler.lua:333: in function citizen:/scripting/lua/scheduler.lua:332
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:348: in function citizen:/scripting/lua/scheduler.lua:319

Here is my server.cfg

you probably don’t want to change these!

only change them if you’re using a server with multiple network interfaces

endpoint_add_tcp “0.0.0.0:30120”
endpoint_add_udp “0.0.0.0:30120”
set es_enableCustomData 1
set mysql_connection_string “server=127.0.0.1;database=essentialmode;userid=root;password=PASSWORD”

start mapmanager
start chat
start spawnmanager
start fivem
start hardcap
start ■■■■■■■

#essentialmode
start mysql-async
start essentialmode
start esplugin_mysql
start es_admin2
add_ace resource.essentialmode command.add_principal allow

sv_scriptHookAllowed 0

change this

rcon_password PASSWORD

sv_hostname “Totes Legit Server - Fail RP Only Pls”

nested configs!

#exec server_internal.cfg

loading a server icon (96x96 PNG file)

#load_server_icon myLogo.png

convars for use from script

set temp_convar “hey world!”

disable announcing? clear out the master by uncommenting this

#sv_master1 “”

want to only allow players authenticated with a third-party provider like Steam?

#sv_authMaxVariance 1
#sv_authMinTrust 5

add system admins

add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don’t allow quit
add_principal identifier.steam:STEAMID group.admin # add the admin to the group

player endpoint protection

sv_endpointprivacy true
set sv_licenseKey “SERVER KEY”

I’ve tried posting in the original topic, but no help

Thanks in advance,

Remove password=PASSWORD and try again

Surely it’ll need that to connect to my database?

“server=127.0.0.1;database=essentialmode;userid=root;password=PASSWORD”

If you have just made your server password=PASSWORD is not needed you just need

“server=127.0.0.1;database=essentialmode;userid=root" Beacuse root does not have a password

Unless they set the password themselves -_-

I’m having a similar issue except my server.cfg looks like this

you probably don’t want to change these!

only change them if you’re using a server with multiple network interfaces

endpoint_add_tcp “0.0.0.0:30120”
endpoint_add_udp “0.0.0.0:30120”

start mapmanager
start chat
start spawnmanager
start sessionmanager
start fivem
start hardcap
start ■■■■■■■
start scoreboard
start es_admin2
start essentialmode
start server-els
start deleteveh
start wk_vehdamage
start frfuel
start ToastysCruiseControl
start AestheticTrees
start RPDeath
start admin-ped
start sandyshore
start server-acl
start paletomap
start harmonymap
start route13lights
start 2017-els-chp-pack
start towtruck2
start TowScript
start mecommand
start docommand
start forest
start vinewoodalive
start akina
start rdd
start lakeside
start landactreservoir
start dwmansion
start FCV
start map
start shops
start weashop
start roleplay-toolbox
start keks
start chat
start camera
start Hospital
start Jailer

start mysql-async
start essentialmode
start esplugin_mysql
start es_admin2
start es_extended

sv_scriptHookAllowed 1

change this

#rcon_password password

sv_hostname “KromStars Freeroam/RP Server 1”

nested configs!

#exec server_internal.cfg

loading a server icon (96x96 PNG file)

#load_server_icon myLogo.png

convars for use from script

set temp_convar “hey world!”

disable announcing? clear out the master by uncommenting this

#sv_master1 “”

want to only allow players authenticated with a third-party provider like Steam?

#sv_authMaxVariance 1
#sv_authMinTrust 5

add system admins

add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don’t allow quit
add_principal identifier.steam:110000118e841c2 group.admin # add the admin to the group

hide player endpoints in external log output

sv_endpointprivacy true

#server slots limit (default to 24)
#sv_maxclients 24

Really, you need all of the ES stuff at the top. Also you haven’t put in your convars for the connection of the database.

Put this above the start resource code.

Change root for the name of UserID of your database (usually root) and the password (if you’ve set one)

Without Password
set es_enableCustomData 1
set mysql_connection_string "server=127.0.0.01;database=essentialmode;userid=root;"
With Password
set es_enableCustomData 1
set mysql_connection_string "server=127.0.0.01;database=essentialmode;userid=root;password=[password]"

Change [password] for your database password (Without the brackets)

I cringe at the thought that “root” is the assumed account, especially without credentials.

Please, everyone, use a non-root account and a password.

Why? There’s no point if you’re on a local computer… like me home hosting a FiveM server…