mysqljs / mysql

A pure node.js JavaScript Client implementing the MySQL protocol.
MIT License
18.32k stars 2.53k forks source link

Error: UNKNOWN_CODE_PLEASE_REPORT: Connection was killed #2350

Open Apollon77 opened 4 years ago

Apollon77 commented 4 years ago

https://sentry.iobroker.net/share/issue/bfbf00157f54442ea5e04695ae4cf661/

Error: UNKNOWN_CODE_PLEASE_REPORT: Connection was killed
  File "/opt/iobroker/node_modules/mysql/lib/protocol/sequences/Sequence.js", line 47, col 14, in Quit.Sequence._packetToError
    var err  = new Error(code + ': ' + packet.message);
  File "/opt/iobroker/node_modules/mysql/lib/protocol/sequences/Sequence.js", line 96, col 17, in Quit.Sequence.ErrorPacket
    this.end(this._packetToError(packet));
  File "/opt/iobroker/node_modules/mysql/lib/protocol/Protocol.js", line 291, col 23, in Protocol._parsePacket
    sequence[packetName](packet);
  File "/opt/iobroker/node_modules/mysql/lib/protocol/Parser.js", line 433, col 10, in Parser._parsePacket
    this._onPacket(packetHeader);
  File "/opt/iobroker/node_modules/mysql/lib/protocol/Parser.js", line 43, col 10, in Parser.write
    this._parsePacket(packetHeader);
  File "/opt/iobroker/node_modules/mysql/lib/protocol/Protocol.js", line 38, col 16, in Protocol.write
    this._parser.write(buffer);
  File "/opt/iobroker/node_modules/mysql/lib/Connection.js", line 88, col 28, in Socket.<anonymous>
    connection._protocol.write(data);
  File "/opt/iobroker/node_modules/mysql/lib/Connection.js", line 526, col 10, in Socket.<anonymous>
    fn.apply(this, arguments);
  File "events.js", line 198, col 13, in Socket.emit
  File "domain.js", line 448, col 20, in Socket.EventEmitter.emit
  File "    --------------------", in null.<anonymous>
  File "/opt/iobroker/node_modules/mysql/lib/protocol/Protocol.js", line 144, col 48, in Protocol._enqueue
    sequence._callSite = sequence._callSite || new Error();
  File "/opt/iobroker/node_modules/mysql/lib/protocol/Protocol.js", line 91, col 23, in Protocol.quit
    var sequence = this._enqueue(new Sequences.Quit(options, callback));
  File "/opt/iobroker/node_modules/mysql/lib/Connection.js", line 239, col 18, in Connection.end
    this._protocol.quit(opts, wrapCallbackInDomain(this, cb));
  File "/opt/iobroker/node_modules/sql-client/lib/connection-factory.js", line 22, col 20, in MySQLConnectionFactory.close_connection
    connection.end();
  File "/opt/iobroker/node_modules/sql-client/lib/sql-client.js", line 51, col 29, in SQLClient.disconnect
    return this.factory.close_connection(this.connection, (err) => {
  File "/opt/iobroker/node_modules/sql-client/lib/sql-client-pool.js", line 42, col 25, in MySQLClientPool.destroy
    return client.disconnect(callback);
  File "/opt/iobroker/node_modules/sql-client/lib/sql-client-pool.js", line 234, col 31, in passivate
    return this.destroy(client, callback);
  File "/opt/iobroker/node_modules/sql-client/lib/sql-client-pool.js", line 37, col 16, in MySQLClientPool.passivate
    return callback(null, client);
  File "/opt/iobroker/node_modules/sql-client/lib/sql-client-pool.js", line 227, col 25, in MySQLClientPool.return
    return this.passivate(client, (err, client) => {
  File "/opt/iobroker/node_modules/iobroker.sql/main.js", line 246, col 43, in returnClientToPool
    return clientPool && clientPool.return(client);
ARitz-Cracker commented 4 years ago

Which server are you using this for?

Apollon77 commented 4 years ago

To be honest I have no idea. It is not an error from my system andf it was also not reported by the affected user. We just got that report via our automated Sentry crash reporting. Sorry that I can not provide more information.

ARitz-Cracker commented 4 years ago

I see, well, I ask because I submitted a pull requests that adds all the MySQL 8 error codes to this library, but MariaDB has their own extended codes that MySQL itself does not have. So I'm wondering if this issue can be closed when my PR is approved or if it should stay open until MariaDB's codes are (eventually) added, or if it was just some custom MySQL server entirely.