Difference between Linux and Windows

Hi at all!

These days I maked a proof. I tested the version build 792 for Windows and the same for Linux with a difference:

  • Windows: Everything is fine;

  • Linux: Everything is fine, but after I disconnect from the server, I recieve these warnings:

[ERROR] [MySQL] An error happens on MySQL for query “SELECT * FROM users WHERE identifier=‘steam:XXXXXXXXXXXX’;”: connect ETIMEDOUT
Error running call reference function for resource esplugin_mysql: citizen:/scripting/lua/scheduler.lua:351: server.lua:16: attempt to index a nil value (local ‘users’)
stack traceback:
server.lua:16: in upvalue ‘ref’
citizen:/scripting/lua/scheduler.lua:337: in function citizen:/scripting/lua/scheduler.lua:336
[C]: in function ‘xpcall’
citizen:/scripting/lua/scheduler.lua:336: in function citizen:/scripting/lua/scheduler.lua:335
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:351: in function citizen:/scripting/lua/scheduler.lua:322
Error: Unhandled error Error: BUFFER_SHORTAGE
at n.e [as reserve] (citizen:/scripting/v8/msgpack.js:29:12766)
at h (citizen:/scripting/v8/msgpack.js:29:15761)
at n.r [as decode] (citizen:/scripting/v8/msgpack.js:29:13908)
at n.fetch (citizen:/scripting/v8/msgpack.js:29:6972)
at n.u [as read] (citizen:/scripting/v8/msgpack.js:29:12076)
at Object.n [as decode] (citizen:/scripting/v8/msgpack.js:29:7097)
at unpack (citizen:/scripting/v8/main.js:20:33)
at citizen:/scripting/v8/main.js:48:11
at setImmediate (mysql-async.js:5039:9)
at Object.callback (citizen:/scripting/v8/timer.js:56:6)

The Windows and the Linux server use the same version of mysql-async, essentialmode and esplugin-mysql and the databases are ok.

What’s the problem? :no_mouth:

Same artifacts version too?

The servers don’t have artifacts started. I encountered this issue only with essentialmode started.

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.

Artifacts are the FiveM server builds, not a resource.

Sounds like an issue with the MySQL async resource, may have more help in the release thread for that.

You didn’t change your connection string to the old format.

This might have to do with the V8 issue currently on Linux. See this comment by the maintainer [Release] MySQL Async Library - 3.2.3

I solved all the issues for now with this steps:

The server run on Linux Mint 19 X64 Cinnamon

  • MySQL Async Library V3.02
  • String
    "set mysql_connection_string “mysql://user:password@localhost/essentialmode?dateStrings=true”

“localhost” is the database address that works in my configuration.