#[ERROR] TypeORM/MySQL - RangeError: The value of "offset" is out of range

1 messages · Page 1 of 1 (latest)

gritty phoenix
#

Hello guys, anyone has ideia of what this errors means, and please can help me?

 undefined ==> ClientHandshake#unknown name(0,,9)
RangeError: The value of "offset" is out of range. It must be >= 0 and <= 5. Received 9

i tried to understand with a search, but i can't find any answer in my context.

i'm trying to build a study case microservice with nestjs, rabbitmq and typeorm with mysql (mysql2 adapter)
repo link: https://github.com/otaldonuness/desapega-user-service

from what i found in internet, i think maybe the errors can be found here:
https://github.com/otaldonuness/desapega-user-service/blob/main/src/user/entities/document.entity.ts
or here: https://github.com/otaldonuness/desapega-user-service/blob/main/src/user/entities/user.entity.ts,
because im think its related with mysql.

Ive found this links ,but i can't understood the context with my case :c

https://stackoverflow.com/questions/60996826/the-value-of-offset-is-out-of-range-it-must-be-0-17825792
https://github.com/sidorares/node-mysql2/issues/989 (i've tried some tips of this issue, but none worked)
https://jira.mongodb.org/browse/NODE-3685

#

mysql2 adaptar log:

[13:00:29] Starting compilation in watch mode...

[13:00:30] Found 0 errors. Watching for file changes.

[Nest] 53917  - 15/03/2023 13:00:31     LOG [NestFactory] Starting Nest application...
Add command: ClientHandshake
[Nest] 53917  - 15/03/2023 13:00:31     LOG [InstanceLoader] AppModule dependencies initialized +49ms
[Nest] 53917  - 15/03/2023 13:00:31     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 53917  - 15/03/2023 13:00:31     LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms
[Nest] 53917  - 15/03/2023 13:00:31     LOG [InstanceLoader] ConfigModule dependencies initialized +0ms
[Nest] 53917  - 15/03/2023 13:00:31     LOG [InstanceLoader] ProxyRMQModule dependencies initialized +0ms
 raw: 0b08051a00
Trace: 
    at PoolConnection.handlePacket (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/connection.js:446:17)
    at PacketParser.onPacket (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/connection.js:94:12)
    at PacketParser.executeStart (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/packet_parser.js:75:16)
    at Socket.<anonymous> (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/connection.js:101:25)
    at Socket.emit (node:events:520:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
#
0 undefined ==> ClientHandshake#unknown name(0,,9)
RangeError: The value of "offset" is out of range. It must be >= 0 and <= 5. Received 9
    at new NodeError (node:internal/errors:371:5)
    at boundsError (node:internal/buffer:86:9)
    at Buffer.readUInt32LE (node:internal/buffer:220:5)
    at Packet.readInt32 (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/packets/packet.js:108:24)
    at Function.fromPacket (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/packets/handshake.js:63:32)
    at ClientHandshake.handshakeInit (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/commands/client_handshake.js:112:40)
    at ClientHandshake.execute (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/commands/command.js:45:22)
    at PoolConnection.handlePacket (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/connection.js:489:32)
    at PacketParser.onPacket (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/connection.js:94:12)
    at PacketParser.executeStart (/Users/arthurnunes-mba/Projects/otaldonunes/desapega-user-service/node_modules/mysql2/lib/packet_parser.js:75:16)
modern violet
#

hello,is there anyway to solve this problem? t tried with "mysql" is ok,but "mysql2" with this err

#

@gritty phoenix