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

Got warning: Warning: got packets out of order. Expected 14 but received 2

Open hungchai opened this issue 6 years ago • 13 comments

When I run the stored procedure query, I always got this message but the data result is correct. How can I disable the warning message.

here is my example code let pool = await mysql.createPool({ "host": systemConfig.get("host"), "user": systemConfig.get("user"), "password": systemConfig.get("password"), "database": systemConfig.get("database"), "connectTimeout": systemConfig.get("connectTimeout"), "acquireTimeout": systemConfig.get("acquireTimeout"), "waitForConnections": systemConfig.get("waitForConnections"), "connectionLimit": systemConfig.get("connectionLimit"), "queueLimit": systemConfig.get("queueLimit"), "multipleStatements": systemConfig.get("multipleStatements"), "charset": systemConfig.get("charset"), "compress": true, "Promise":global.Promise }); let conn = await pool.getConnection(); let res = conn.query("CALL xxx (?,?,?)",['1212','1','fdsfs']);

hungchai avatar Apr 26 '18 07:04 hungchai

hi @hungchai What's the server version you are using? Is there any way you can prepare docker image that I can pull to reproduce this?

sidorares avatar Apr 26 '18 07:04 sidorares

Engine MySQL 5.6.27

As this is an AWS RDS, I cannot re-produce the same env in docker.

hungchai avatar Apr 26 '18 07:04 hungchai

at the moment this is not configurable, the only way to disable warning is to comment out this line - https://github.com/sidorares/node-mysql2/blob/80c55ef2b60572ef7b0ac7bee2eb45db8de6a516/lib/connection.js#L459

I wonder if packet order AWS RDS server sends is actually incorrect or there is a bug in client code. If there is no sensitive information in your query, can you add debug: true to you createPool() config and post what you get in the output?

sidorares avatar Apr 26 '18 07:04 sidorares

how can i pm you?

hungchai avatar Apr 26 '18 07:04 hungchai

I will mask the hex data from raw: xxx before send to you. Is it alright for you to debug?

hungchai avatar Apr 26 '18 08:04 hungchai

It could be that important bit (packet headers) is in hex. At least leave unmasked first 4 bytes of each line (8 hex chars)

sidorares avatar Apr 26 '18 08:04 sidorares

I revised the question. I found the warning message coming from when querying stored procedure

hungchai avatar Apr 26 '18 08:04 hungchai

sent to your email

hungchai avatar Apr 26 '18 08:04 hungchai

Any updates

hungchai avatar May 03 '18 00:05 hungchai

I'm having the same warning (using AWS RDS), did you fixed it @hungchai ? Can't you just put the warnings under an flag or .on-like event @sidorares ?

Alynva avatar Nov 02 '21 05:11 Alynva

I'm experiencing the same warning when connecting to mysql 8.

TehShrike avatar Dec 10 '21 20:12 TehShrike

Same here

jchapelle avatar Sep 15 '22 09:09 jchapelle