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
363 stars 93 forks source link

I am encountering a connection issue when using the latest version of the MariaDB npm package (3.2.0) in my Node.js application. Downgrading to version 2.1.4 resolves the problem. Here are the details of the issue #282

Open E2-Dayanithi opened 2 months ago

E2-Dayanithi commented 2 months ago

Issue Description:

I am encountering a connection issue when using the latest version of the MariaDB npm package (3.2.0) in my Node.js application. Downgrading to version 2.1.4 resolves the problem. Here are the details of the issue:

Environment:

Node.js Version: v20.12.2 Mariadb npm Package Version (Old): 2.1.4 Mariadb npm Package Version (New): 3.2.0 Sequelize npm Version: 6.37.3

Steps to Reproduce:

Update the MariaDB npm package to version 3.2.0 in a Node.js application. Attempt to establish a connection to the MariaDB server using Sequelize. Notice that the connection fails with the latest version of the MariaDB npm package.

Expected Behavior:

The latest version of the MariaDB npm package should allow successful connection to the MariaDB server using Sequelize, similar to the behavior observed with version 2.1.4.

Actual Behavior:

The connection to the MariaDB server fails when using the latest version (3.2.0) of the MariaDB npm package.

Additional Information:

Error Messages: Include any error messages or stack traces that are generated when the connection fails. Configuration Details: Provide details of the connection configuration used in your application (e.g., host, port, username, password). Any other relevant information or observations that might help diagnose the issue. Reproducible Example (if possible):

If possible, provide a minimal, reproducible example (e.g., a simplified Node.js application) that demonstrates the issue.

Potential Cause (if known):

If you have any insights into what might be causing the issue (e.g., compatibility issues with Node.js or Sequelize), please share them here.

Note:

I have verified that the issue persists across multiple environments. Downgrading to version 2.1.4 of the MariaDB npm package allows successful connection to the MariaDB server. Thank you for your attention to this matter. Let me know if you need any further information or assistance in resolving this issue.

rusher commented 2 months ago

mariadb connector works with sequelize : see sequelize tests I've create a mini project https://github.com/rusher/nodejs-issue-282 (npm install + node ./index.js) connection works as expected. So this seems a configuration issue. Could you indicate your configuration to confirm ?

Leigh-M commented 3 weeks ago

I can confirm I also experience a connection issue with latest that is resolved by down-grading to 2.1.4

Just with basic setup (AWS lambda, node v20):

    const pool = mariadb.createPool({
        host: 'some-host,
        user: 'some-username,
        database: 'some-DB',
        password: 'some-pw'
        connectionLimit: 5
    });

        const pool = await createPool();
        UMSConnection = await pool.getConnection();
        const rows = await UMSConnection.query('SELECT 1 as val1');

        console.log('rows => ', rows);

Connection hangs/ times-out. Surprised more people aren't experiencing similar - please thumbs-up this issue if you do also.