rodrigogs / mysql-events

A node package that watches a MySQL database and runs callbacks on matched events.
BSD 3-Clause "New" or "Revised" License
137 stars 53 forks source link

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds #39

Open ikheetjeff opened 3 years ago

ikheetjeff commented 3 years ago

Hi,

When i start my application, and i do a UPDATE from my database, i get this error:

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer b                                                                                                                                                             ounds
    at new NodeError (node:internal/errors:329:5)
    at boundsError (node:internal/buffer:84:11)
    at Buffer.readUInt8 (node:internal/buffer:252:5)
    at parseBinaryBuffer (/projects/whatsapp/complimaatje/node_modules/@rodrigog                                                                                                                                                             s/zongji/lib/json_decode.js:55:24)
    at module.exports (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/z                                                                                                                                                             ongji/lib/json_decode.js:28:25)
    at Object.exports.readMysqlValue (/projects/whatsapp/complimaatje/node_modul                                                                                                                                                             es/@rodrigogs/zongji/lib/common.js:468:16)
    at readRow (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/l                                                                                                                                                             ib/rows_event.js:111:16)
    at UpdateRows._fetchOneRow (/projects/whatsapp/complimaatje/node_modules/@ro                                                                                                                                                             drigogs/zongji/lib/rows_event.js:143:13)
    at UpdateRows.RowsEvent (/projects/whatsapp/complimaatje/node_modules/@rodri                                                                                                                                                             gogs/zongji/lib/rows_event.js:62:27)
    at new UpdateRows (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/z                                                                                                                                                             ongji/lib/rows_event.js:135:13) {
  code: 'ERR_BUFFER_OUT_OF_BOUNDS'
}
Error: Packets out of order. Got: 28 Expected: 7
    at Parser._tryReadPacketHeader (/projects/whatsapp/complimaatje/node_modules                                                                                                                                                             /mysql/lib/protocol/Parser.js:470:15)
    at Parser.write (/projects/whatsapp/complimaatje/node_modules/mysql/lib/prot                                                                                                                                                             ocol/Parser.js:33:29)
    at processTicksAndRejections (node:internal/process/task_queues:76:11)
    --------------------
    at Protocol._enqueue (/projects/whatsapp/complimaatje/node_modules/mysql/lib                                                                                                                                                             /protocol/Protocol.js:144:48)
    at Immediate._start (/projects/whatsapp/complimaatje/node_modules/@rodrigogs                                                                                                                                                             /zongji/index.js:240:31)
    at processImmediate (node:internal/timers:464:21) {
  code: 'PROTOCOL_PACKETS_OUT_OF_ORDER',
  fatal: true
}

It happends sometimes, but not always. How can i fix this?

ikheetjeff commented 3 years ago

Debug log:

`<-- (4052) RowDataPacket { COLUMN_NAME: 'mode', COLLATION_NAME: 'utf8mb4_0900_ai_ci', CHARACTER_SET_NAME: 'utf8mb4', COLUMN_COMMENT: '1 = "elke week", 2 = "elke twee weken"', COLUMN_TYPE: "enum('1','2','3')" }

<-- (4052) EofPacket { fieldCount: 254, warningCount: 0, serverStatus: 2, protocol41: true }

<-- (4054) BinlogHeader { _error: RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds at new NodeError (node:internal/errors:329:5) at boundsError (node:internal/buffer:84:11) at Buffer.readUInt8 (node:internal/buffer:252:5) at parseBinaryBuffer (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/json_decode.js:55:24) at module.exports (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/json_decode.js:28:25) at Object.exports.readMysqlValue (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/common.js:468:16) at readRow (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/rows_event.js:111:16) at UpdateRows._fetchOneRow (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/rows_event.js:143:13) at UpdateRows.RowsEvent (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/rows_event.js:62:27) at new UpdateRows (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/rows_event.js:135:13) { code: 'ERR_BUFFER_OUT_OF_BOUNDS' } }

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds at new NodeError (node:internal/errors:329:5) at boundsError (node:internal/buffer:84:11) at Buffer.readUInt8 (node:internal/buffer:252:5) at parseBinaryBuffer (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/json_decode.js:55:24) at module.exports (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/json_decode.js:28:25) at Object.exports.readMysqlValue (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/common.js:468:16) at readRow (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/rows_event.js:111:16) at UpdateRows._fetchOneRow (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/rows_event.js:143:13) at UpdateRows.RowsEvent (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/rows_event.js:62:27) at new UpdateRows (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/lib/rows_event.js:135:13) { code: 'ERR_BUFFER_OUT_OF_BOUNDS' } Error: Packets out of order. Got: 48 Expected: 7 at Parser._tryReadPacketHeader (/projects/whatsapp/complimaatje/node_modules/mysql/lib/protocol/Parser.js:470:15) at Parser.write (/projects/whatsapp/complimaatje/node_modules/mysql/lib/protocol/Parser.js:33:29) at processTicksAndRejections (node:internal/process/task_queues:76:11)

at Protocol._enqueue (/projects/whatsapp/complimaatje/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Immediate._start (/projects/whatsapp/complimaatje/node_modules/@rodrigogs/zongji/index.js:240:31)
at processImmediate (node:internal/timers:464:21) {

code: 'PROTOCOL_PACKETS_OUT_OF_ORDER', fatal: true } `

IUGAI1398 commented 9 months ago

the same!

IUGAI1398 commented 9 months ago

try edit or add
"binlog_format = row" to my.cnf file