Skip to content

RangeError [ERR_OUT_OF_RANGE] when parsing result fields #2053

Open
@ubnt-michals

Description

@ubnt-michals

I am getting following error:

https://sentry.io/share/issue/dc40781d83fd437184bca7ee5cde56be/

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 1074. Received 2377
  File "internal/buffer.js", line 49, col 9, in boundsError
  File "internal/buffer.js", line 361, col 5, in Buffer.readInt32BE
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 630, col 22, in Connection.parseInt32
    var value = buffer.readInt32BE(this.offset)
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 535, col 21, in Connection._readValue
    var length = this.parseInt32(buffer)
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 528, col 26, in Connection.parseD
    msg.fields.push(this._readValue(buffer))
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 377, col 19, in Connection.parseMessage
    return this.parseD(buffer, length)
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 120, col 22, in Socket.<anonymous>
    var msg = self.parseMessage(packet)
  File "events.js", line 189, col 13, in Socket.emit
  File "domain.js", line 441, col 20, in Socket.EventEmitter.emit
  File "_stream_readable.js", line 284, col 12, in addChunk
  File "_stream_readable.js", line 265, col 11, in readableAddChunk
  File "_stream_readable.js", line 220, col 10, in Socket.Readable.push
  File "internal/stream_base_commons.js", line 94, col 17, in TCP.onStreamRead [as onread]
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 542. Received -19
  File "internal/buffer.js", line 49, col 9, in boundsError
  File "internal/buffer.js", line 361, col 5, in Buffer.readInt32BE
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 630, col 22, in Connection.parseInt32
    var value = buffer.readInt32BE(this.offset)
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 535, col 21, in Connection._readValue
    var length = this.parseInt32(buffer)
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 528, col 26, in Connection.parseD
    msg.fields.push(this._readValue(buffer))
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 377, col 19, in Connection.parseMessage
    return this.parseD(buffer, length)
  File "/home/app/unms/node_modules/pg/lib/connection.js", line 120, col 22, in Socket.<anonymous>
    var msg = self.parseMessage(packet)
  File "events.js", line 189, col 13, in Socket.emit
  File "domain.js", line 441, col 20, in Socket.EventEmitter.emit
  File "_stream_readable.js", line 284, col 12, in addChunk
  File "_stream_readable.js", line 265, col 11, in readableAddChunk
  File "_stream_readable.js", line 220, col 10, in Socket.Readable.push
  File "internal/stream_base_commons.js", line 94, col 17, in TCP.onStreamRead [as onread]
  • pg - 7.8.0
  • postgesql - 9.6.12

I don't have failing server response yet, I am still trying to reproduce the issue.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions