node-mysql2 icon indicating copy to clipboard operation
node-mysql2 copied to clipboard

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

Open infusion opened this issue 1 year ago • 1 comments

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:

  • MySQL version: 8.0.37-29 (Percona Server)
  • Ubuntu: 20.04.6 LTS
  • node v20.17.0
  • mysql2 3.11.0

infusion avatar Sep 07 '24 05:09 infusion

Hi, @infusion 🙋🏻‍♂️

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

wellwelwel avatar Sep 10 '24 13:09 wellwelwel

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

infusion avatar Oct 21 '24 12:10 infusion