[FIXED] Mysql + Async Setup on Ubuntu?


#1

So I’m getting a server setup on an Ubuntu VPS but I’m not too sure how to get Mysql + Async setup, could someone link a tutorial or something along those lines?


#2

Setup is nothing different than setting it up on window.

Only thing different is installing the database:


#3

Hey man, do you know how to fix this issue? first time setting up my server i followed a tutorial everything works but got that one error

Dankje


#4

No clue. I was able to get MySQL running and I was able to set up non-root access with heidi. Nothing more, no clue how to get Async to run or anything like that.


#5

The account you use has insufficient permissions.

Create a new account and grant all permissions:

NOTE: Granting all permissions to a user is kinda a safety hazard for production, grant only the permissions you actually need. But for a testing environment it’s perfectly fine.


#6
`-------------------------------------------------------------
--- No errors detected, essentialmode is setup properly. ---
-------------------------------------------------------------
Loaded MySqlConnector, Version=0.26.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_1792167535
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Option 'databse' not supported.
  at MySql.Data.MySqlClient.MySqlConnectionStringOption.GetOptionForKey (System.String key) [0x0001e] in <5d2e43c2aa6f4da0bb43a6a12077ad51>:0
  at MySql.Data.MySqlClient.MySqlConnectionStringBuilder.set_Item (System.String key, System.Object value) [0x00000] in <5d2e43c2aa6f4da0bb43a6a12077ad51>:0
  at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString (System.String value) [0x00049] in <976f86829f9e47109a7e32cf6a56334b>:0
  at MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor (System.String connectionString) [0x00006] in <5d2e43c2aa6f4da0bb43a6a12077ad51>:0
  at MySQLAsync.MySQLAsync.Configure (System.String connectionStringConfig, System.Boolean debug) [0x00000] in <47c31aecc66e42ceb969da352f30fd4c>:0
  at MySQLAsync.MySQLAsync.<.ctor>b__2_0 () [0x00047] in <47c31aecc66e42ceb969da352f30fd4c>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
   --- End of inner exception stack trace ---


Server stack trace:
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
  at CitizenFX.Core.FunctionReference.Invoke (System.Int32 reference, System.Byte[] arguments) [0x00061] in /src/code/client/clrcore/FunctionReference.cs:62
  at CitizenFX.Core.InternalManager.CallRef (System.Int32 refIndex, System.Byte[] argsSerialized, System.IntPtr& retvalSerialized, System.Int32& retvalSize) [0x00000] in /src/code/client/clrcore/InternalManager.cs:243
  at (wrapper remoting-invoke-with-check) CitizenFX.Core.InternalManager:CallRef (int,byte[],intptr&,int&)
  at (wrapper xdomain-dispatch) CitizenFX.Core.InternalManager:CallRef (object,byte[]&,byte[]&,int,byte[],int&)

Exception rethrown at [0]:
  at (wrapper xdomain-invoke) CitizenFX.Core.InternalManager:CallRef (int,byte[],intptr&,int&)
  at (wrapper remoting-invoke-with-check) CitizenFX.Core.InternalManager:CallRef (int,byte[],intptr&,int&)
  at CitizenFX.Core.MonoScriptRuntime.CallRef (System.Int32 refIndex, System.Byte[] argsSerialized, System.Int32 argsSize, System.IntPtr& retvalSerialized, System.Int32& retvalSize) [0x00013] in /src/code/client/clrcore/MonoScriptRuntime.cs:151
Error running system event handling function for resource mysql-async: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: citizen:/scripting/lua/scheduler.lua:453: An error happened while calling export mysql_configure of resource mysql-async (citizen:/scripting/lua/MessagePack.lua:830: missing bytes), see above for details
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:453: in method 'mysql_configure'
        lib/init.lua:3: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
hitch warning: frame time of 272 milliseconds

Current version: 4.6.3
Updater version: 4.6.3

Everything is fine!

Connecting: TestUser
Sending heartbeat to live-internal.fivem.net:30110
Error occurred while attempting to find user in CouchDB.
Error running call reference function for resource es_admin2: server.lua:261: attempt to index a nil value (local 'user')
stack traceback:
        server.lua:261: in local 'ref'
        citizen:/scripting/lua/scheduler.lua:317: in function <citizen:/scripting/lua/scheduler.lua:308>
Error running system event handling function for resource essentialmode: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: 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:378: in field 'cmd'
        server/main.lua:123: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Sending heartbeat to live-internal.fivem.net:30110
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Sending heartbeat to live-internal.fivem.net:30110
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Sending heartbeat to live-internal.fivem.net:30110
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/main.lua:556: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:556: in field '?'
        server/functions.lua:30: in field 'TriggerServerCallback'
        server/common.lua:72: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
`

I keep getting this error.


#7

Looks like you made a typo.


#8
Error occurred while attempting to find user in CouchDB.
Error running call reference function for resource es_admin2: server.lua:261: attempt to index a nil value (local 'user')
stack traceback:
        server.lua:261: in local 'ref'
        citizen:/scripting/lua/scheduler.lua:317: in function <citizen:/scripting/lua/scheduler.lua:308>
Error running system event handling function for resource essentialmode: citizen:/scripting/lua/sc                     heduler.lua:41: Failed to execute thread: 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:378: in field 'cmd'
        server/main.lua:123: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>

Alrighty, now that fixed my silly typo. It’s giving me this error, it looks like its looking for couchdb. Which I have a couchdb, but for several plugins I’d like to use it requires a-sync. Do I need them set up in tandem?


#9

Guess i gots to figure it out myself.


#10

Read the error:

server.lua:261: attempt to index a nil value (local ‘user’)

The user variable is nil, fix it?


#11

I wish I knew how to do that, but I’m brand new to this. Learning as I go.


#12

Then post the code. (line 261 + whats before it and after it, ± 10 lines).


#13
					RconPrint("Money set")
					TriggerClientEvent('chatMessage', tonumber(args[1]), "CONSOLE", {0, 0, 0}, "Your money has been set to: ^2^*$" .. tonumber(args[2]))
				end
			end)

			CancelEvent()
		end
end)

-- Default commands
TriggerEvent('es:addCommand', 'admin', function(source, args, user)
	TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Level: ^*^2 " .. tostring(user.get('permission_level')))
	TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Group: ^*^2 " .. user.getGroup())
end, {help = "Shows what admin level you are and what group you're in"})

-- Default commands
TriggerEvent('es:addCommand', 'report', function(source, args, user)
	table.remove(args, 1)
	TriggerClientEvent('chatMessage', source, "REPORT", {255, 0, 0}, " (^2" .. GetPlayerName(source) .." | "..source.."^0) " .. table.concat(args, " "))

TriggerEvent("es:getPlayers", function(pl)
		for k,v in pairs(pl) do
			TriggerEvent("es:getPlayerFromId", k, function(user)
				if(user.getPermissions() > 0 and k ~= source)then
					TriggerClientEvent('chatMessage', k, "REPORT", {255, 0, 0}, " (^2" .. GetPlayerName(source) .." | "..source.."^0) " .. table.concat(args, " "))
				end
			end)
		end
	end)
end, {help = "Report a player or an issue", params = {{name = "report", help = "What you want to report"}}})

LINE 261 es_admin server.lua TriggerEvent(“es:getPlayers”, function(pl)

I think that’s the one it’s looking for.