We are running a FiveM server that is bare bones at the moment trying to run EssentialMode but have yet to get it working. We have tried coucheDB, mySQL and both external SQL servers as well as local provided SQL servers. Nothing seems to work.
Our problem seems to be that nothing is being written to the database. The plugin is providing no useful errors and in couchDB it will actually create the database but no documents. In SQL we imported the table and database but again the plugin won’t write to it. We’ve followed the tutorials and still nothing. We are hosting it on a dedicated windows server if I need to provide the host I can but they seem to be very reputable within the community.
Here are the install directions we are following (for SQL because that would be mos ideal to get working)
download and place essentialmode, es_admin2, esplugin_mysql, mysql-async all into the /resource folder
import sql.sql from esplugin_mysql to our SQL database
open server.cfg
add the following in this order: mysql-async, essentialmode, esplugin)mysql, es_admin2
above those add set es_enableCustomData 1 and the mysql-async connection string (note, we have tried putting these in the convar sections and above the start lines and neither have changed anything) (secondary note, we have tried 127.0.0.1 and the direct IP and that hasn’t changed anything as well as disabling SSL mode)
Start the server
One of the questions we are unsure of is if we need to add the server_script '@mysql-async/lib/MySQL.lua line to any resource files. It is by default in the esplugin_mysql but we are not sure if we need to add it into essentialmode or es_admin. Any help?
The only “error” I can give you is:
Error running call reference function for resource es_admin2: server.lua:261: attempt to index a nil value (local 'user')
[ 98360] stack traceback:
[ 98360] server.lua:261: in local 'ref'
[ 98375] citizen:/scripting/lua/scheduler.lua:278: in function <citizen:/scripting/lua/scheduler.lua:269>
[ 98375] Error running system event handling function for resource essentialmode: citizen:/scripting/lua/scheduler.lua:39: Failed to execute thread: citizen:/scripting/lua/MessagePack.lua:830: missing bytes
[ 98391] stack traceback:
[ 98391] [C]: in function 'error'
[ 98407] citizen:/scripting/lua/MessagePack.lua:830: in method 'underflow'
[ 98407] citizen:/scripting/lua/MessagePack.lua:465: in field 'any'
[ 98422] citizen:/scripting/lua/MessagePack.lua:860: in field 'unpack'
[ 98422] citizen:/scripting/lua/scheduler.lua:339: in field 'cmd'
[ 98438] server/main.lua:123: in upvalue 'handler'
[ 98438] citizen:/scripting/lua/scheduler.lua:124: in function <citizen:/scripting/lua/scheduler.lua:123>
[ 98438] stack traceback:
[ 98453] [C]: in function 'error'
[ 98453] citizen:/scripting/lua/scheduler.lua:39: in field 'CreateThreadNow'
[ 98469] citizen:/scripting/lua/scheduler.lua:123: in function <citizen:/scripting/lua/scheduler.lua:92>
[ 143813] Sending heartbeat to live-internal.fivem.net:30110
[ 323860] Sending heartbeat to live-internal.fivem.net:30110
[ 503922] Sending heartbeat to live-internal.fivem.net:30110
KennyL and myself cannot get it working at all and we are just not quite sure why. Any help would be greatly appricated.
Well I really don’t know what this error could be, my suggestion is, remove all mysql/async and essential mode plugins and start from scratch, even the databases. Once you start from scratch and get it working you could move existing data over.
I’ve tried that probably close to 25 or more times at this point. I’ve tried various versions of mySQL async and reinstalled the full sql server, tried one that we use for some of our websites (a dedicated external SQL node). I have tried redownloading all the plugins and everything but we cannot get it worked out. The error seems to be just a generic error saying it can’t grab the user from the database (the user table is not having data written to it so makes sense) but there are no other errors that say why it can’t write.
Here is my server.cfg (remember I have moved the convars to the proper section and it didn’t work there right now they are at the top)
# 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" #I set these to 0.0.0.0 they are the proper IP in the actual server.cfg
set es_enableCustomData 1
set mysql_connection_string "server=127.0.0.1;database=essentialmode;userid=fivem43416;password=*********"
start mapmanager
start chat
start spawnmanager
start sessionmanager
start fivem
start hardcap
start ■■■■■■■
start scoreboard
start mysql-async
start essentialmode
start esplugin_mysql
start es_admin2
sv_scriptHookAllowed 0
# change this
rcon_password ******
sv_hostname "Server Name"
# nested configs!
#exec server_internal.cfg
# loading a server icon (96x96 PNG file)
load_server_icon logo.png
# convars for use from script
# set mysql_connection_string
# server=127.0.0.1;database=essentialmode;userid=gtav;password=*********"
# 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:110000112345678 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 32
Here you go, I’ve only added the TOP part of the server.cfg file since that’s only important here. Make sure that what you see here (except for the endpoint_add… parts) is at the top of the file.
Not sure why this works but it seems to work perfect for me, even if I set the couchdb comvars. It only saves in MySQL which is what we want in this case.
#Starting core FiveM resources
start mapmanager
start chat
start spawnmanager
start fivem
start hardcap
start ■■■■■■■
start scoreboard
#Setting convar for essentialmode
set es_enableCustomData 1
set mysql_connection_string "server=127.0.0.1;database=essentialmode;userid=<username>;password=<password>"
set es_couchdb_url "127.0.0.1"
set es_couchdb_port "5984"
set es_couchdb_password "<username>:<password>"
#Starting database plugins
start mysql-async
start essentialmode
start esplugin_mysql
start es_admin2
#Starting custom resources
start acl
start afkkick
#etc, etc
How would I know? Just try and see if it helps, for some people it seems to work, not everyone though.
there’s too much you could’ve done wrong that causes your problems, without some more info about your situation we can’t possibly know whether this file will work for you…
If it doesn’t work give us some more info so we can narrow down some common issues.
I was asking to the another guy , I saw the thread with SOLVED …
Well thank’s for you’r help my situation is the server.cfg , it’s not working for me … I’am on a dedicated game server , so I had to use the mysql plugin … I cannot pass with the couchDB …
I was having the same issues and found my fix to be that I was trying to use two different steam accounts on the same game license. Even though both steam account own the game individually, my local FIVEM install is only pointed to ONE game folder.
To test this theory, I backed up my “user” table and then removed myself from the table. Logged in and was able to create a new character.
I have a problem while setting up essentialmode. I don’t seem to have limit and some scripts like basicneeds are needing limit in the DB. How do i create the limit or what essentialmode has it?