Scheduler and missing bytes error

Hello when I start my fx server (i did own an old server but fx is so complicated), I got an error; I don’t know why. this is the error i had when i log in to my server (i did upload the sql file from esplugin_mysql and put identifier as primary key). i got newest version from master and essentials:

Started resource es_admin2
Started resource fivem
Started gametype Freeroam
Started resource hardcap
Started resource ■■■■■■■
Started resource scoreboard
Started resource loadingscreen
cfx> Resolved live-internal.fivem.net:30110 to 151.80.44.223:30110
Sending heartbeat to live-internal.fivem.net:30110
Started resource fivem-map-skater
Started map fivem-map-skater

Current version: 4.6.1
Updater version: 4.6.1

Everything is fine!

Loaded MySqlConnector, Version=0.24.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_285012073
hitch warning: frame time of 409 milliseconds
Connecting: Jager Bom
Sending heartbeat to live-internal.fivem.net:30110
Triggering!
Loaded System.Threading.Tasks.Extensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 into ScriptDomain_285012073
Loaded System.Buffers, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 into ScriptDomain_285012073
Error running call reference function for resource essentialmode: server/player/login.lua:9: attempt to index a boolean value (local 'user')
stack traceback:
        server/player/login.lua:9: in local 'ref'
        citizen:/scripting/lua/scheduler.lua:277: in function <citizen:/scripting/lua/scheduler.lua:268>
Error running call reference function for resource esplugin_mysql: 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:338: in upvalue 'callback'
        server.lua:29: in local 'ref'
        citizen:/scripting/lua/scheduler.lua:277: in function <citizen:/scripting/lua/scheduler.lua:268>
[ERROR] [] Check the error above, an error happens when executing the callback from the query : "SELECT * FROM users WHERE `identifier`=@identifier; {identifier=steam:XXXXXXXXXXXXXX}"

^^ this is when i got an empty database and when i relog (2 times) i got this :

Sending heartbeat to live-internal.fivem.net:30110
Connecting: Jager Bom
Sending heartbeat to live-internal.fivem.net:30110
nil     ~=      2
Triggering!
[ERROR] [] An error happens on MySQL for query "INSERT INTO users (`identifier`, `money`, `bank`, `group`, `permission_level`) VALUES (@identifier, @money, @bank, @group, @permission_level); {identifier=steam:XXXXXXXXXX;group=user;permission_level=0;money=0;bank=0}": Duplicate entry 'steam:XXXXXXXXXX' for key 'PRIMARY'
Sending heartbeat to live-internal.fivem.net:30110
Connecting: Jager Bom
Sending heartbeat to live-internal.fivem.net:30110
nil     ~=      3
Triggering!
[ERROR] [] An error happens on MySQL for query "INSERT INTO users (`identifier`, `money`, `bank`, `group`, `permission_level`) VALUES (@identifier, @money, @bank, @group, @permission_level); {identifier=steam:XXXXXXXXXX;group=user;permission_level=0;money=0;bank=0}": Duplicate entry 'steam:XXXXXXXXX' for key 'PRIMARY'

my server.crg file:

# 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"


##########configuration
set mysql_connection_string "server=localhost;database=essentialmode;userid=root;password=XXXXXXX"
set es_enableCustomData 1

start mapmanager
start chat
start spawnmanager
start mysql-async
start essentialmode
start esplugin_mysql
start es_admin2
start fivem
start hardcap
start ■■■■■■■
start scoreboard
start loadingscreen


sv_scriptHookAllowed 0

and so on

and this is the config file of essentialmode (but configs doesn’t matter because i use esplugin_mysql and mysql-async) or am i wrong ?

ip = GetConvar('es_couchdb_url', '127.0.0.1') 	-- Change to wherever your DB is hosted, use convar
port = GetConvar('es_couchdb_port', '5984') 	-- Change to whatever port you have CouchDB running on, use convar
auth = GetConvar('es_couchdb_password', 'root:1202') 	-- "user:password", if you have auth setup, use convar

thanks in advance for your time and responding me

If you’re referring to this error:

The problem lies in the fact that whatever Steam ID you’re trying to insert already exists, hence the “duplicate entry xxxx”. I’m not so sure about the other error, though.

Just to let you know, these two lines tell you which resources are causing the issue. You will need to talk to the developer of “EssentialMode” in regards to the error.

I’m closing this as it has nothing to do with FiveM itself. Please, in future, read the warning messages when creating a post in bug reports (its for FiveM, not the addons) :slightly_smiling_face:

2 Likes