-
-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: got packets out of order. Expected 1 but received 28 #528
Comments
I think it's an issue with mysql2 server implementation. Need to add proper sequence id handling server side. It's a bit tricky, you increment it with each packet but reset at the start of command |
I'm having the same issue, with lots of these messages being displayed:
I got 591 of these from streaming back 601874 records. |
how to resolve it? |
@einsqing is there any way to make example I can reproduce? Is it coming from client or using |
@sidorares
client.js
|
I am seeing the same behavior using the documented example proxy and an example client request such as listed above by @einsqing.
Please let me know if there is further testing I can do or examples I can provide. Mysql server v5.7. |
Experiencing the same issue. |
the same here but with different packets... |
Passei a receber esse erro hoje. Um Ano se passou e ninguém soube como resolver? |
same... Warning: got packets out of order. Expected 0 but received 1 |
The packets need to be reset at various points (found by trial and error!). I'll try and post an example ASAP. FYI, my experience has only been with a proxy use case. |
Just update to latest NODE version and BAG!! 14.17.5 |
Am using 14.17.6 and got this error. My script uploads a large amount of local data in batch to a local MySQL server that is running in a docker container. Edit: const mysql = require('mysql2')
const pool = mysql.createPool({
connectionLimit: 10,
...
})
pool.query(
'INSERT INTO table_name (col1, col2, ...) VALUES ?',
/* Data in a 3d array (very large). val1, val2, etc are either strings or null. */
[[[val1, val2], [val1, val2], ...]],
...
) In my case this issue rarely happens. Only 8 times out of the 130,000 |
Is there anybody has resolved this problem? |
Same problem here |
@gajus How did you fix it. I currently have the same issue. |
Sorry, it was 3 years ago – I don't recall the outcome. I typically follow up if I do find a solution though. I am guessing I moved to other solving problems. |
@gajus Understandable. This issue is driving me crazy. At this point i'm thinking to move to another package. With me it is only occuring when I run it in a docker container. When I run barebone node everything works. |
Has anyone yet noticed that it leads to unusual behavior or even errors? Or is it just a warning that you can ignore? |
@bttger I use this package with a feathersJS backend and FeathersVuex frontend. This error causes feathers to error in "cannot read property parse of undefined". And no realtime updates are issued. So in my case it broke my whole app. I rolled back to v2.2.4 and it seems to be fixed. |
I had this issue many month ago when using mysql2 for a project. I ended up having to manually reset the sequencId's (through trial and error and packet analysis). Ive done my best to extract the important parts of the code where these need to be set. In my example is was using a proxy which requires a server, so this should be relevant for both. The snippet below will not execute, its just for illustrative purposes. Summary of where to set sequenceId:
I am no expert but after seeing so may people still have this issue, hopefully it helps :) const server = mysql.createServer()
server.listen(4000, '0.0.0.0', () => {
logger.info('proxy accepts new connections on port ' + 4000)
})
server.on('connection', async conn => {
conn.serverHandshake({
protocolVersion: 10,
serverVersion: '5.7',
connectionId: connectionId++,
statusFlags: 2,
characterSet: 8,
capabilityFlags: 0xffffff ^ ClientFlags.SSL,
authCallback: async data => {
try {
...
remoteConn = await proxy.createConnection(cache)
remoteConn.connect(err => {
if (err) {
if (err.message === TOO_MANY_USER_CONNECTIONS) {
return conn.writeError({
message: TOO_MANY_USER_CONNECTIONS,
code: ER_TOO_MANY_USER_CONNECTIONS,
})
}
conn.writeError(err)
return
}
conn.writeOk()
conn.sequenceId = 0
})
} catch (err) {
logger.error(err)
conn.writeError(err)
}
},
})
conn.on('ping', async () => {
conn.writeOk()
conn.sequenceId = 0
})
conn.on('query', async sql => {
try {
logger.debug(sql)
conn.sequenceId = 1
const {
data: [results, fields],
isDql,
} = await proxy.onQuery(sql, remoteConn, cacheId)
...
} catch (error) {
logger.error(error)
} finally {
conn.sequenceId = 0
}
}) |
I see these errors when the connection thread I updated the
|
Still have exactly the same problem. My logs keep getting spammed of this at every request i make, even when i'm just starting the project. I use connection pool, and just execute queries on connection. Node 14.15.5 Tried downgrading / upgrading :
But it didn't changed anything. Note that my database is hosted on AWS RDS, maybe it matters. Not sure what is the problem, but to be frank, i don't really want to manage this by myself, either by handling myself sequenceId, or anything else. Is there a meaning to logging this without user knowing ? Since it's a warning, and i have the issue since a long time, it doesn't seems to be anything so serious. Maybe add an option to enable / disable logs like this on the package end ? Any news on this @sidorares ? |
Getting this problem in production on mysql 8, mysql2 package (was also getting on mysql package). Perhaps the problem is mysql8. |
I also got the same error. Is the cause of this error in node-mysql2 or in mysql itself? Why is this problem left unattended? |
Can you fix this ? |
Getting the same error. My environment:
and the minimal reproduction code: const conn = await createConnection({
host: 'localhost',
user: 'feightwywx',
password: '',
database: 'some_database'
});
const [rows, fields] = await conn.execute(myQueryString);
conn.destroy(); I've tried setting However, since I started to use Update: For |
i have same issue when checking a winlogger. but i only have 2 warning.
|
I am trying to create a MySQL server using
node-mysql2
, but I am getting the following errors:This is the server initialization code, https://github.com/gajus/seeql/blob/fb615713a6fe3b856c543d2dd5e27286ba3e665a/src/index.js#L135-L142.
What am I missing?
Using Node.js v7.7.1.
The text was updated successfully, but these errors were encountered: