[SOLVED] [HELP] EssentialMode setup not working

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)

  1. download and place essentialmode, es_admin2, esplugin_mysql, mysql-async all into the /resource folder
  2. import sql.sql from esplugin_mysql to our SQL database
  3. open server.cfg
  4. add the following in this order: mysql-async, essentialmode, esplugin)mysql, es_admin2
  5. 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)
  6. 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.

I don’t think that you need to put it anywhere else. Also you’re best off replying to the EssentialMode topic, instead of creating a brand new one.

Oh I tried… Owner just throws a fit because “I don’t support SQL… this isn’t reproducible” and “Follow the instructions” which I believe I have.

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.

You have the convars in your server.cfg file correctly setup as well as the startup order correct?

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

I don’t be have time right now but I’ll send you mine tomorrow, I’ve got a different order of things which seems to work fine.

Sounds good. Thank you.

How did you resolve this? I get it now.

I’ll send my server.cfg file later today, seems to help a few people so I’ll post it here.

2 Likes

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
1 Like

Hi , does the server.cfg help you or did you find something else ? I have got the same error , and no log is adding into the database too … :confused: thank’s

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.

1 Like

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 …

Here’s some screen of my configuration :

MySQL : screen , screen2 , screen3 , screen4

server.cfg : screen

FTP : screen , screen2

Error In game : screen , screen2

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.

hmm can someone help (?)

1 Like

duplication of resources check maybe you have another mysql

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?

when i try download a file to my essentialmode this comes up any help?