[Release] MySQL Async Library - 3.3.2

Fucking awesome! I’ll update all the ESX resources to utilize this.

I updated and now i get this error
Error: (node:14548) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘3’ of null
at parseConnectingString (mysql-async.js:5124:30)
at global.on (mysql-async.js:5140:18)
at citizen:/scripting/v8/main.js:183:28
Error: (node:14548) 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:14548) [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.

Heya mate, not 100% sure but I’ve starting getting this error since 3.0 was released. My immediate thought isn’t this resource but I’m curious around why it is being referenced. Do you have any ideas on that? Cheers, Grew.

Error Code from Console
Error running call reference function for resource esx_license: citizen:/scripting/lua/scheduler.lua:351: server/main.lua:73: attempt to index a nil value (field '?')
stack traceback:
        server/main.lua:73: 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)
Error running call reference function for resource esx_license: citizen:/scripting/lua/scheduler.lua:351: server/main.lua:73: attempt to index a nil value (field '?')
stack traceback:
        server/main.lua:73: 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)
Sending heartbeat to live-internal.fivem.net:30110
Access denied for command add_principal.
Error running system event handling function for resource esx_whitelistEnhanced: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server/whitelist_sv.lua:213: bad argument #1 to 'remove' (position out of bounds)
stack traceback:
        [C]: in function 'table.remove'
        server/whitelist_sv.lua:213: 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>

@aaron_roberts Thank you for giving me your connection string so I can figure out what is wrong [you might want to replace your password].

@Grewsome that seems some issue with the resource esx_license. which comes from returning null/nil. e.g. something in the queries of esx_license. I do not have enough free time to setup esx with esx_license and trying to figure out what causes the issue exactly. Which you would need to help me with. In your cause I would set mysql_debug 1 and see which query causes it. Usually you should see directly why.

I suspect esx_license does not set a variable correctly. Thus a certain query fails completely.

Guys please. I got this issue: Does not help me fixing potential issues at all. Only if I can reproduce the issue locally, I can fix it.

suddenly started getting this error

Error running call reference function for resource esx_joblisting: citizen:/scripting/lua/scheduler.lua:351: server/main.lua:30: attempt to index a nil value (upvalue ‘xPlayer’)
stack traceback:
server/main.lua:30: 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)

You should ask esx_joblisting

attempt to index a nil value (upvalue ‘xPlayer’)

Causes mysql-async to error out. Maybe @zr0iq can implements something to prevent mysql from dying when there is an error in the user callback :slight_smile:

edit: Figure me a retard.

I don’t think mysql-async dies. But I am not certain, maybe I should try and look into that when I have more time.

After fixing most of the errors I only have one left and here it is:


I am not sure how to fix it nor does it make any sense. I know its connected to the database so I’m stumped.

It does not detect your connection string as valid.

You know it is connected? Odd, because it cannot connect.

Use the old connection string type if you want it easier:

host=localhost;uid=username;pwd=password;database=db

Edit: Fixed issue by editing the MySQL server authentication method to legacy. If anyone else has this issue contact me and I can tell you how to fix it.

Hmm that’s really weird I was getting notified that it was saving but I tried your suggestion and got the same error then I tired another format and now I am getting this error that I had before.

Why there are too many errors just started the CMD, something with Buffer_Shortage and errors that I did not have before, someone broke up the plugin?

Seems like usual mysql8 bullshit as usual.

ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';

should fix the issue for the user you want to login as.

edit: I think just mysql8’s sha256 passwords are not supported yet. The old 2.x connector had a bug there too, a different one.

1 Like

any possible fix for the errors came out when starting server?

The new update is breaking all command on any server that start with /
reverting to the previous version fixed my problem

That makes no sense whatsoever. It does not even call any commands or interacting with it. Also I might point out that I tested short gameplay with mysql-async running.

And nothing breaks for me. If noone makes your issues reproducable for me, there won’t be a fix or whatsoever, because I cannot magically see where the issues are coming from.

Well everything work number one without the newest version.
But once you install it and you try to do a command that start with / you get the error
Invalid ref call attempt : NUMBERHERE

Well the commands work for me, as I said. It does not break for me. So I cannot reproduce the issue.

I’ve the same issue.

Invalid ref call attempt : Number

when i downgrade mysql-async version : No problem

Would you want me to provide me with some of your files and sql so I could check it? Can send it to me on discord. Matti#4268.

I just need something that is reproducable to fix it.

i’ve had the same problem… the fix was reverting to windows build artifact server from 6th september… since newer builds were destroying my server commands