You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been having this issue all the time with my server. I just could never find a solution to my probleme. Here is the error I am getting:
events.js:353
throw er; // Unhandled 'error' event
^
Error: Packets out of order. Got: 0 Expected: 17
at Parser._tryReadPacketHeader (G:\webserver\node_modules\mysql\lib\protocol\Parser.js:470:15)
at Parser.write (G:\webserver\node_modules\mysql\lib\protocol\Parser.js:33:29)
at Protocol.write (G:\webserver\node_modules\mysql\lib\protocol\Protocol.js:38:16)
at Socket.<anonymous> (G:\webserver\node_modules\mysql\lib\Connection.js:88:28)
at Socket.<anonymous> (G:\webserver\node_modules\mysql\lib\Connection.js:526:10)
at Socket.emit (events.js:376:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
Emitted 'error' event on Connection instance at:
at Connection._handleProtocolError (G:\webserver\node_modules\mysql\lib\Connection.js:423:8)
at Protocol.emit (events.js:376:20)
at Protocol._delegateError (G:\webserver\node_modules\mysql\lib\protocol\Protocol.js:398:10)
at Protocol.handleParserError (G:\webserver\node_modules\mysql\lib\protocol\Protocol.js:380:10)
at Parser._tryReadPacketHeader (G:\webserver\node_modules\mysql\lib\protocol\Parser.js:478:10)
at Parser.write (G:\webserver\node_modules\mysql\lib\protocol\Parser.js:33:29)
[... lines matching original stack trace ...]
at Socket.emit (events.js:376:20) {
code: 'PROTOCOL_PACKETS_OUT_OF_ORDER',
fatal: true
}
Here is my connection (self made mini sql module):
const mysql = require('mysql')
class Database {
constructor( config ) {
this.connection = mysql.createConnection( config )
}
query( sql, args ) {
return new Promise((resolve, reject) => {
this.connection.query( sql, args, (err, res ) => {
if (err) {return reject(err);};
resolve(res)
})
})
}
end() {
return new Promise((resolve, reject) => {
this.connection.end(err => {
if (err) {return reject(err);}
resolve()
})
})
}
}
module.exports = Database;
I only ever make one connection. Is this my problem?
The text was updated successfully, but these errors were encountered:
I have the same problem. I set the connection to the base, sent a couple of requests and everything worked. After some time of inaction led to this error. [email protected] (github:mysqljs/mysql#3430c513d6b0ca279fb7c79b210c9301e9315658)
I have been having this issue all the time with my server. I just could never find a solution to my probleme. Here is the error I am getting:
Here is my connection (self made mini sql module):
I only ever make one connection. Is this my problem?
The text was updated successfully, but these errors were encountered: