mysqljs / mysql

A pure node.js JavaScript Client implementing the MySQL protocol.
MIT License
18.27k stars 2.52k forks source link

UNKNOWN_CODE_PLEASE_REPORT: JSON syntax error at byte 0 of object 1. Error: Invalid value. Contents just before that byte: #2524

Closed nojvek closed 2 years ago

nojvek commented 2 years ago

Trying to run this statement, seems the driver errors out.

Error: UNKNOWN_CODE_PLEASE_REPORT: JSON syntax error at byte 0 of object 1. Error: Invalid value. Contents just before that byte: .
    at Query.Sequence._packetToError (/home/ubuntu/frontend/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
    at Query.ErrorPacket (/home/ubuntu/frontend/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
    at Protocol._parsePacket (/home/ubuntu/frontend/node_modules/mysql/lib/protocol/Protocol.js:291:23)
    at Parser._parsePacket (/home/ubuntu/frontend/node_modules/mysql/lib/protocol/Parser.js:433:10)
    at Parser.write (/home/ubuntu/frontend/node_modules/mysql/lib/protocol/Parser.js:43:10)
    at Protocol.write (/home/ubuntu/frontend/node_modules/mysql/lib/protocol/Protocol.js:38:16)
    at Socket.<anonymous> (/home/ubuntu/frontend/node_modules/mysql/lib/Connection.js:88:28)
    at Socket.<anonymous> (/home/ubuntu/frontend/node_modules/mysql/lib/Connection.js:526:10)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    --------------------
    at Protocol._enqueue (/home/ubuntu/frontend/node_modules/mysql/lib/protocol/Protocol.js:144:48)
    at Connection.query (/home/ubuntu/frontend/node_modules/mysql/lib/Connection.js:198:25)
    at node:internal/util:363:7
    at new Promise (<anonymous>)
    at bound query (node:internal/util:349:12)
    at etlTable (/home/ubuntu/frontend/scripts/mongo/mongoToSingleStore.ts:146:59)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 'UNKNOWN_CODE_PLEASE_REPORT',
  errno: 2328,
  sqlMessage: 'JSON syntax error at byte 0 of object 1. Error: Invalid value. Contents just before that byte: .',
  sqlState: 'HY000',
  index: 0,
  sql: "LOAD DATA LOCAL INFILE '/home/ubuntu/frontend/somefile.json.gz' REPLACE SKIP CONSTRAINT ERRORS INTO TABLE `order` FORMAT JSON"
}
nojvek commented 2 years ago

Never mind, it's another issue unrelated to the driver.