sidorares / node-mysql2

:zap: fast mysqljs/mysql compatible mysql driver for node.js
https://sidorares.github.io/node-mysql2/
MIT License
4.07k stars 619 forks source link

Warning: got packets out of order. Expected 2 but received 0 (on close() ) #3021

Closed infusion closed 2 weeks ago

infusion commented 2 months ago

I saw quite a few tickets concerning this error here already, but none are reporting it for a connection close. I updated a setup using Percona server and mysql2, which worked perfectly well for years but can't say where this error is coming from now. The problem arises only when all queries were sent and a final await conn.close() is sent. No pooling is used here, just a simple

db = await mysql.createConnection()
await db.query(query)
await db.close() // where the error occurs

Here are the versions used:

wellwelwel commented 1 month ago

Hi, @infusion 🙋🏻‍♂️

I quickly checked https://docs.percona.com/percona-server/8.0/quickstart-docker.html. Could you share a local reproduction?

infusion commented 2 weeks ago

I don't know why but upgrading to mysql2 3.11.3 fixed the issue. Thanks!