Following the instructions here https://github.com/brouznouf/fivem-mysql-async, I downgrade the version of mysql-async to 2.1, but when I start the Linux server with these warnings after the "Everythings is fine " line:
InvokeNative: execution failed: Argument at index 1 was null.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.ArgumentException: Value does not fall within the expected range.
Server stack trace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR (System.Int32 errorCode) [0x0000a] in <49fde7938a9b47b480042d844e818c7e>:0
at (wrapper cominterop) CitizenFX.Core.IScriptHost.InvokeNative(CitizenFX.Core.fxScriptContext&)
at (wrapper cominterop-invoke) CitizenFX.Core.IScriptHost.InvokeNative(CitizenFX.Core.fxScriptContext&)
at CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.InvokeNative (CitizenFX.Core.fxScriptContext& context) [0x00000] in /src/code/client/clrcore/MonoScriptRuntime.cs:254
at (wrapper remoting-invoke-with-check) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.InvokeNative(CitizenFX.Core.fxScriptContext&)
at (wrapper xdomain-dispatch) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.InvokeNative(object,byte[]&,byte[]&)
Exception rethrown at [0]:
at (wrapper xdomain-invoke) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.InvokeNative(CitizenFX.Core.fxScriptContext&)
at CitizenFX.Core.ScriptContext.InvokeInternal (System.UInt64 nativeIdentifier, CitizenFX.Core.IScriptHost scriptHost) [0x0000c] in /src/code/client/clrcore/ScriptContext.cs:184
at CitizenFX.Core.ScriptContext.Invoke (System.UInt64 nativeIdentifier, CitizenFX.Core.IScriptHost scriptHost) [0x00000] in /src/code/client/clrcore/ScriptContext.cs:177
at CitizenFX.Core.Native.Function.InvokeInternal (CitizenFX.Core.Native.Hash nativeHash, System.Type returnType, CitizenFX.Core.Native.InputArgument[] args) [0x00026] in /src/code/client/clrcore/Native.cs:28
at CitizenFX.Core.Native.Function.Call[T] (CitizenFX.Core.Native.Hash hash, CitizenFX.Core.Native.InputArgument[] arguments) [0x00000] in /src/code/client/clrcore/Native.cs:11
at MySQLAsync.MySQLAsync.<.ctor>b__2_0 () [0x00037] in <6f835765886c4fada3e5ffb1ffcd6998>: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 <49fde7938a9b47b480042d844e818c7e>: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 <49fde7938a9b47b480042d844e818c7e>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <49fde7938a9b47b480042d844e818c7e>:0
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <49fde7938a9b47b480042d844e818c7e>:0
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <49fde7938a9b47b480042d844e818c7e>: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:249
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:665: 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:665: in method ‘mysql_configure’
lib/init.lua:3: in upvalue ‘handler’
citizen:/scripting/lua/scheduler.lua:175: in function citizen:/scripting/lua/scheduler.lua:174
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:41: in field ‘CreateThreadNow’
citizen:/scripting/lua/scheduler.lua:174: in function citizen:/scripting/lua/scheduler.lua:138
I saw in the forum these errors are present in other topics, but I didn’t read if they are solved or no.