[Release] MySQL Async Library - 3.0.8

dev
mysql
basemods

#629

i fix the error.
i was using this in the server config
set mysql_connection_string “addr=127.0.0.1;uid=username;database=essentialmode;pwd=password”

and i changed to this code and all worked
set mysql_connection_string “server=127.0.0.1;database=essentialmode;userid=username;password=password”


#630

oh well, I’m on an old version of mysql-async. Doesn’t really say.


#631

Hey everyfing worked find when i installed the basics for ESX but first start up and i got this error anybody that can help me?


#632

@orros01 use localhost in the connection string.
@gamziboi server version, but I think you use according to some other topic zap anyways?
@Beardlife you need to give some more information than, I got issue x,y,z? Maybe update your artifacts version.


#633

Hi @zr0iq
First of all thank you for the work done on this version!

However, on my test server, i have a [MySQL] [Slow Query Warning].

[MySQL] [Slow Query Warning] [esplugin_mysql] [842ms] UPDATE users SET `bank`=229643,`money`=2150 WHERE `identifier`='steam:xxxxxxxxxxxxxxx'
[MySQL] [Slow Query Warning] [esplugin_mysql] [1106ms] UPDATE users SET `bank`=23703,`money`=119045 WHERE `identifier`='steam:steam:xxxxxxxxxxxxxxx'

~ 520 users.

Simple question :
These are just warnings ? And to avoid this, we should review the MysQl requests ?

I have the last artefact version for linux and the last version of your mysql-async.
Version of mysql : Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Cordially,
Hal.


#634

You should add an index over identifier.


#635

Hi,
Thanks for you reply. Can I have one exemple for this mysql table? (if it’s possible for you)

Thanks on advance.


Edit
Like this ? :

ALTER TABLE `users` ADD INDEX( `identifier`);

Cordially Hal.


#636

EDIT: I have found the issue. I finally saw the mistake. I was using MYSQL in all the places I should have been using MySQL.


#637

Forgot to reply. Yes.

ALTER TABLE `tablename` ADD INDEX `index_name` (`columns`);

You can have an index over multiple columns. Every column that is mentioned in a WHERE statement should be indexed.


#638

Hi,
No problem ! Thanks for your answer :grin:


#640

I went from my old Server to a new root Server, the SQL Database is still the same but still getting this error and model ist not loading any ideas?

[ERROR] [MySQL] An critical error happens on MySQL for query “SELECT * FROM users {=}”: Object reference not set to an instance of an object at MySqlConnector.Core.ConnectionPool.GetPool (System.String connectionString) [0x0001a] in <149068887d4e4bc08e7b4c05a59a923b>:0
at MySql.Data.MySqlClient.MySqlConnection.CreateSessionAsync (System.Nullable1[T] ioBehavior, System.Threading.CancellationToken cancellationToken) [0x00012] in <149068887d4e4bc08e7b4c05a59a923b>:0 at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable1+ConfiguredValueTaskAwaiter[TResult].GetResult () [0x0001e] in <4ac30274d31c4b8099694c24336fcb22>:0
at MySql.Data.MySqlClient.MySqlConnection.OpenAsync (System.Nullable1[T] ioBehavior, System.Threading.CancellationToken cancellationToken) [0x000bc] in <149068887d4e4bc08e7b4c05a59a923b>:0 at MySQLAsync.Operation1[TResult].ExecuteAsync (System.String query, System.Collections.Generic.IDictionary`2[TKey,TValue] parameters, CitizenFX.Core.CallbackDelegate callback, System.Boolean debug) [0x000aa] in <6f835765886c4fada3e5ffb1ffcd6998>:0

Best wishes! :smiley:


#641

After installing ver. 3.0.8 i keep getting this error in my console

Error: (node:23157) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: unexpected PromiseRejectEvent
    at process.<anonymous> (internal/process/promises.js:27:25)
    at <anonymous>
    at Query.db.query [as _callback] (mysql-async.js:4973:13)
    at Query.Sequence.end (mysql-async.js:280:24)
    at Query.ErrorPacket (mysql-async.js:2122:8)
    at Protocol._parsePacket (mysql-async.js:5941:23)
    at Parser.write (mysql-async.js:6198:12)
    at Protocol.write (mysql-async.js:5701:16)
    at Socket.<anonymous> (mysql-async.js:693:28)
    at emitOne (events.js:116:13)
Error: (node:23157) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Error: (node:23157) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Error: (node:23157) UnhandledPromiseRejectionWarning: Error: ER_BAD_FIELD_ERROR: Unknown column 'isDead' in 'field list'
    at Query.Sequence._packetToError (mysql-async.js:244:14)
    at Query.ErrorPacket (mysql-async.js:2109:18)
    at Protocol._parsePacket (mysql-async.js:5941:23)
    at Parser.write (mysql-async.js:6198:12)
    at Protocol.write (mysql-async.js:5701:16)
    at Socket.<anonymous> (mysql-async.js:693:28)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    --------------------
    at Pool.query (mysql-async.js:4728:23)
    at Promise (mysql-async.js:4970:12)
    at new Promise (<anonymous>)
    at execute (mysql-async.js:4967:26)
    at Object.global.exports [as callback] (mysql-async.js:5001:5)
    at citizen:/scripting/v8/main.js:87:41
Error: (node:23157) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

#642

I’m having just a few scripts that are reporting delays I just wanted to know how I could fix them, or if someone has already fixed any of them and could I help.


#643

some of them iterate through big tables, which is causing issues, or selecting entire tables.

I do not think most of those queries are salvagable to be fast. Unless the resources are rewritten. You can try indexing owned and time in the tables truck_inventory2 and gcphone respectively.

But i doubt that it will change a lot in your use case.


#644

Hey I’ve tried to install this but I keep getting an error on startup. Cant figure out what’s causing it. It seems that I have installed everything correctly and gone over everything 100 times to make sure it’s right but I still get it. it doesn’t matter if the credentials that I put into the server.cfg file are correct or not, it still throws this error. Any suggestions on a possible fix or solution?

Server.cfg:

set database_driver "mysql-async"
set mysql_connection_string "server=127.0.0.1;database=essentialmode;userid=admin;password=admin"

# Starting Mysql-async
start mysql-async

# Starting Essentialmode
start essentialmode
start esplugin_mysql
start es_admin
start async

# Starting ESX
start es_extended

Error:

WARNING: NON-EXISTENT NATIVE 000000004d52fe5b
[ERROR] [MySQL] [null] An error happens on MySQL for query “[object Object]”: ER
_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol reques
ted by server; consider upgrading MySQL client
Error: (node:9128) UnhandledPromiseRejectionWarning: Error: ER_NOT_SUPPORTED_AUT
H_MODE: Client does not support authentication protocol requested by server; con
sider upgrading MySQL client
at Handshake.Sequence._packetToError (mysql-async.js:244:14)
at Handshake.ErrorPacket (mysql-async.js:12834:18)
at Protocol._parsePacket (mysql-async.js:5941:23)
at Parser.write (mysql-async.js:6198:12)
at Protocol.write (mysql-async.js:5701:16)
at Socket. (mysql-async.js:693:28)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
--------------------
at Protocol._enqueue (mysql-async.js:5807:48)
at Protocol.handshake (mysql-async.js:5714:23)
at PoolConnection.connect (mysql-async.js:720:18)
at Pool.getConnection (mysql-async.js:4577:16)
at Pool.query (mysql-async.js:4731:8)
at Promise (mysql-async.js:4970:12)
at new Promise ()
at execute (mysql-async.js:4967:26)
at global.exports (mysql-async.js:4993:5)
at citizen:/scripting/v8/main.js:78:40
Error: (node:9128) UnhandledPromiseRejectionWarning: Unhandled promise rejection
. This error originated either by throwing inside of an async function without a
catch block, or by rejecting a promise which was not handled with .catch(). (re
jection id: 1)
Error: (node:9128) [DEP0018] DeprecationWarning: Unhandled promise rejections ar
e deprecated. In the future, promise rejections that are not handled will termin
ate the Node.js process with a non-zero exit code.
hitch warning: frame time of 929 milliseconds


#645

Update your server. I am currently still busy, sadly. Will hopefully be able to do some improvements over the holidays.


#646

Hey I finally figured it out after hours of failure!

For anyone else that might be possibly experiencing this issue here is my solution:
1.

Uninstall MySQL Server 8.0 with the MySQL Installer (https://dev.mysql.com/downloads/installer/)
MAKE SURE TO BACKUP ANY DATABASES THAT YOU MIGHT WANT TO KEEP

Install MySQL Server 5.6 with the MySQL Installer

Reboot Computer

Profit

  1. (Didn’t work for me, might for you)

Do Reconfigure Authentication Method,there you select legacy type password support for 5.1

Reason for the error

*You Installed latest Mysql 8.0 ,it has deferent authentication method. degrading 5.6 or 5.1 is simple solution

source: https://stackoverflow.com/questions/44946270/er-not-supported-auth-mode-mysql-server


#647

i have a error that just started to happen after i cleared my servers cache

[ERROR] [MySQL] An critical error happens on MySQL for query “SELECT * FROM shops LEFT JOIN items ON items.name = shops.item {=}”: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException (System.ExceptionResource resource) [0x0000b] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
at System.Collections.Generic.Dictionary2[TKey,TValue].Insert (TKey key, TValue value, System.Boolean add) [0x0007c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Collections.Generic.Dictionary2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
at MySQLAsync.FetchAll+d__2.MoveNext () [0x000e9] in <6b79789832b34a31961dbb39358e1b3f>:0
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at MySQLAsync.Operation1+d__3[TResult].MoveNext () [0x00169] in <6b79789832b34a31961dbb39358e1b3f>:0


#648

does someone know why i get this?

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:768: 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:768: in method ‘mysql_configure’ lib/init.lua:3: in upvalue ‘handler’ citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218> stack traceback: [C]: in function ‘error’ citizen:/scripting/lua/scheduler.lua:41: in field ‘CreateThreadNow’ citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182> hitch warning: frame time of 370 milliseconds


#649

i still get a error even tho i have that and all my stuff is correct can you help me fix it ?