mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
369 stars 91 forks source link

Issue with a client... for some reason got those strange messages. #265

Closed cooffeeRequired closed 4 days ago

cooffeeRequired commented 9 months ago
2023-12-17 15:57:59 2023-12-17 14:57:59 16 [Warning] Aborted connection 16 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)
2023-12-17 15:57:59 2023-12-17 14:57:59 17 [Warning] Aborted connection 17 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)
2023-12-17 15:57:59 2023-12-17 14:57:59 22 [Warning] Aborted connection 22 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)
2023-12-17 15:57:59 2023-12-17 14:57:59 20 [Warning] Aborted connection 20 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)
2023-12-17 15:57:59 2023-12-17 14:57:59 18 [Warning] Aborted connection 18 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)
2023-12-17 15:57:59 2023-12-17 14:57:59 24 [Warning] Aborted connection 24 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)
2023-12-17 15:57:59 2023-12-17 14:57:59 23 [Warning] Aborted connection 23 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)
2023-12-17 15:57:59 2023-12-17 14:57:59 19 [Warning] Aborted connection 19 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)
2023-12-17 15:57:59 2023-12-17 14:57:59 21 [Warning] Aborted connection 21 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)
2023-12-17 15:57:59 2023-12-17 14:57:59 25 [Warning] Aborted connection 25 to db: 'unconnected' user: 'root' host: '172.17.0.1' (Got an error reading communication packets)

    constructor(database?: string) {
        const databaseConfig = {
            host: process.env.dabatase_host || "localhost",
            port: parseInt(process.env.mariadb_port || "3306"),
            user: process.env.mariadb_user,
            password: process.env.mariadb_pass,
            //connectionLimit: 20
        };

        if (!database) {
            this.pool = mariadb.createPool(databaseConfig);
        } else {
            this.database = database;
            this.pool = mariadb.createPool({ database, ...databaseConfig });
        }

        if (!this.pool) {
            error(`🦊 MariaDB pool is not configured`);
        }
    }
cooffeeRequired commented 9 months ago

After using a [Symbol.dispose] it start works..

rusher commented 9 months ago

After using a [Symbol.dispose] it start works..

What do you mean by that ? did you add something like :

[Symbol.dispose]: () => {
    this.pool.end();
  },

or was it something else ?

DVLP commented 7 months ago

I have the same error Using:

When using mysql2 I'm not getting these messages

DVLP commented 7 months ago

Under Sequelize connection config there was this line. I don't remember what was it for. Commenting it out helped. instance.afterConnect(connection => new Promise(resolve => connection.query('SET NAMES UTF8MB4;', resolve))) With mysql2 it doesn't cause any issues.