Skip to content
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

RangeError: The value of "offset" is out of range. It must be >= 0 and <= 5254. Received 5261 #2565

Open
dresende opened this issue Nov 23, 2023 · 0 comments

Comments

@dresende
Copy link
Collaborator

I'm opening the issue on behalf of Marc Delpont:

I manage a MySQL DB with geospatial data stored in a table. When I query the data from node.js, some of the records are returned with geodata parsed as expected, but nearly 40% of the records are casting the following error (with different values of offset) :

---
 RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 5254. Received 5261
at new NodeError (node:internal/errors:371:5)
at boundsError (node:internal/buffer:86:9)
at Buffer.readDoubleForwards [as readDoubleLE] (node:internal/buffer:564:5)
at parseGeometry (/var/www/api-mountain/v2/node_modules/mysql/lib/protocol/Parser.js:309:38)
at Parser.parseGeometryValue (/var/www/api-mountain/v2/node_modules/mysql/lib/protocol/Parser.js:341:10)
at RowDataPacket.typeCast (/var/www/api-mountain/v2/node_modules/mysql/lib/protocol/packets/RowDataPacket.js:118:21)
 at RowDataPacket.parse (/var/www/api-mountain/v2/node_modules/mysql/lib/protocol/packets/RowDataPacket.js:36:16)
at Query.RowDataPacket (/var/www/api-mountain/v2/node_modules/mysql/lib/protocol/sequences/Query.js:153:10)
at Protocol._parsePacket (/var/www/api-mountain/v2/node_modules/mysql/lib/protocol/Protocol.js:260:14)
at Parser._parsePacket (/var/www/api-mountain/v2/node_modules/mysql/lib/protocol/Parser.js:433:10)
---

It seems that the geometry parser of mysql lib fails to calculate the buffer offset in some cases and returns an offset outise the buffer length.
I'm not expreimented enough to debug this issue, so I hope you can have a look at it.

I'm waiting for more information about versions and system being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant