Skip to content

运行过程中遇到大段文字插入的SQL语句会报RangeError [ERR_INVALID_ARG_VALUE]: The argument 'size' is invalid.错误 #4

@mykioer

Description

@mykioer

检查psocket.ts文件_extractData方法中let bodySize: number = this.readHeader.readInt32BE(0);其中bodySize返回为负数-443709664导致buffer.alloc错误。
以下是报错:
RangeError [ERR_INVALID_ARG_VALUE]: The argument 'size' is invalid. Received -443709664
at Function.alloc (node:buffer:372:3)
at PSocket._extractData (C:\Users\Administrator\Desktop\canal-nodejs-master\src\psocket.ts:144:35)
at Handler.resolve (C:\Users\Administrator\Desktop\canal-nodejs-master\src\psocket.ts:65:62)
at PSocket._onReceiveData (C:\Users\Administrator\Desktop\canal-nodejs-master\src\psocket.ts:111:27)
at Socket.emit (node:events:513:28)
at Socket.emit (node:domain:489:12)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Socket.Readable.push (node:internal/streams/readable:234:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
code: 'ERR_INVALID_ARG_VALUE'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions