[Release] MySQL Async Library - 3.3.2

Error running system event handling function for resource esplugin_mysql: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: citizen:/scripting/lua/scheduler.lua:655: No such export mysql_fetch_all in resource mysql-async
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:655: in metamethod ‘__index’
@mysql-async/lib/MySQL.lua:143: in field ‘fetchAll’
server.lua:15: 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

Got this when connecting with an account to my localhost server

Hi, i get this error when pepole join my server, anyone knows why?

Uncaught TypeError: Cannot convert undefined or null to object
mysql-async.js(5083,49): pool.query
mysql-async.js(1094,10):
mysql-async.js(1060,16):
mysql-async.js(275,24): Sequence.end
mysql-async.js(2216,8): Query._handleFinalResultPacket
mysql-async.js(2200,8): Query.EofPacket
mysql-async.js(6197,23): Protocol._parsePacket
mysql-async.js(6458,12): write
mysql-async.js(5957,16): Protocol.write
mysql-async.js(683,28):

TypeError: Cannot convert undefined or null to object

Getting this error after updating to the newest artifacts.

(node:12268) [DEP0095] DeprecationWarning: timers.enroll() is deprecated. Please use setTimeout instead.
(node:12268) [DEP0095] DeprecationWarning: timers.enroll() is deprecated. Please use setTimeout instead.
(node:12268) [DEP0126] DeprecationWarning: timers.active() is deprecated. Please use timeout.refresh() instead.
(node:12268) [DEP0126] DeprecationWarning: timers.active() is deprecated. Please use timeout.refresh() instead.
(node:12268) [DEP0096] DeprecationWarning: timers.unenroll() is deprecated. Please use clearTimeout instead.
(node:12268) [DEP0096] DeprecationWarning: timers.unenroll() is deprecated. Please use clearTimeout instead.

I attempted the change but then the script would not load properly. Anyone else experience this issue? Is this actually something that will affect the server?

Here are the lines in mysql a-sync that this is refering to.

mysql-async.js

var self = this;
  sequence
    .on('error', function(err) {
      self._delegateError(err, sequence);
    })
    .on('packet', function(packet) {
      Timers.active(sequence);
      self._emitPacket(packet);
    })
    .on('end', function() {
      self._dequeue(sequence);
    })
    .on('timeout', function() {
      var err = new Error(sequence.constructor.name + ' inactivity timeout');

      err.code    = 'PROTOCOL_SEQUENCE_TIMEOUT';
      err.fatal   = true;
      err.timeout = sequence._timeout;

      self._delegateError(err, sequence);
    })
    .on('start-tls', function() {
      Timers.active(sequence);
      self._connection._startTLS(function(err) {
        if (err) {
          // SSL negotiation error are fatal
          err.code  = 'HANDSHAKE_SSL_ERROR';
          err.fatal = true;
          sequence.end(err);
          return;
        }

        Timers.active(sequence);
        sequence._tlsUpgradeCompleteHandler();
      });
    });

 Timers.active(sequence);

Protocol.prototype._dequeue = function(sequence) {
  Timers.unenroll(sequence);

Protocol.prototype._startSequence = function(sequence) {
  if (sequence._timeout > 0 && isFinite(sequence._timeout)) {
    Timers.enroll(sequence, sequence._timeout);
    Timers.active(sequence);
  }

possibly due to what i found below

Did you happen to get this updated by any chance? I just updated to the latest artifact 1684 from 1682 and started to get this message as well.

Is there an update for the new FX update?

I got part of it changed correctly. When I get a chance I’ll share what I have gotten fixed but one part I cant figure out

Awesome man appreciate the work as I’m sure everyone else that pays attention does too. Keep us updated! Thanks again.

1 Like

sorry it took so long. This is what I got in mysql-async.js

It works and gets rid of most of the warnings but from my research clearTimeout should be set up like this

“clearTimeout = sequence” but it doesnt work that way. It works the way I have in the code below. I included entire code that I have working. I am unable to get the “DeprecationWarning: timers.active() is deprecated. Please use timeout.refresh() instead” to clear as any time I attempt to fix that part it breaks the code and give the error below.

"Uncaught ReferenceError: timeout is not defined
@mysql-async/mysql-async.js(5970,3): Protocol._parsePacket
@mysql-async/mysql-async.js(6238,12): write
@mysql-async/mysql-async.js(5741,16): Protocol.write
@mysql-async/mysql-async.js(693,28):
events.js(210,5): emit
_stream_readable.js(308,12): addChunk
_stream_readable.js(289,11): readableAddChunk
_stream_readable.js(223,10): Readable.push
internal/stream_base_commons.js(182,23): onStreamRead

ReferenceError: timeout is not defined
[ERROR] read ECONNRESET"

I was able to change timers.active successfully on all but 2 lines to timeout.refresh. The code should work but will still show 2 lines of

“(node:11864) [DEP0126] DeprecationWarning: timers.active() is deprecated. Please use timeout.refresh() instead.”

mysql-async.js (534.1 KB)

That mysql-async.js download isn’t working for me. I click the download and all I get is this,

The change you wanted was rejected.

Maybe you tried to change something you didn’t have access to.

1 Like

same for me

I have tried fixing this several times myself but its never changing. Would anyone know how to fix this

Hi there, can you share the file on another way?

There is no solution yet? the download of the repair you uploaded does not work.

This is the solution until further notice: Mysql-Async with newer mysqljs.

4 Likes

could someone help me with this?

Use older c# version of library?

Please update mysql-async

commit : https://github.com/brouznouf/fivem-mysql-async/commit/5a3c6474dae26bbf4dae825cb99e82f195cb26ea

What is this error and does it effect something in the server and is there a way to fix it?

image

How can I truncate an table with this script?