Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Not a Bug
-
2.5.26
-
nodejs 16, mariadb connector 3.1.2 and maxscale 2.5.26
Description
Part of our setup is a nodejs socket component running on nodejs 16 and using mariadb connector 3.1.2. It should connect to mascale, running version 2.5.26, routing to 3 mariadb servers.
The maxscale + database setups works without any issues with our PHP backend, but not with the nodejs + mariadb connector part.
We see strange errors as this:
sqlMessage: 'The MariaDB server is running with the --read-only option so it cannot execute this statement',
sql: 'SELECT user_companies.company_id\n' +
' FROM user_companies\n' +
' WHERE user_companies.user_id = 2001766 - parameters:[]',
fatal: false,
errno: 1290,
sqlState: 'HY000',
code: 'ER_OPTION_PREVENTS_STATEMENT'
SqlError: (conn=2345476, no: 1927, SQLState: HY000) Authentication to 'db02' failed: 1047, #08S01: Unknown command (db02)
sql: SELECT user_devices.user_id, user_devices.ip_address, users.online_status FROM user_devices JOIN users ON (users.id = user_devices.user_id) WHERE users.deleted IS NULL AND user_devices.device_id = 'xxx' AND user_devices.app_secret = 'xxx' AND user_devices.lease > 1687208453 - parameters:[]
at Object.module.exports.createError (/nodejs/node_modules/mariadb/lib/misc/errors.js:61:10)
at PacketNodeEncoded.readError (/nodejs/node_modules/mariadb/lib/io/packet.js:572:19)
at Query.readResponsePacket (/nodejs/node_modules/mariadb/lib/cmd/parser.js:55:28)
at PacketInputStream.receivePacketBasic (/nodejs/node_modules/mariadb/lib/io/packet-input-stream.js:82:9)
at PacketInputStream.onData (/nodejs/node_modules/mariadb/lib/io/packet-input-stream.js:132:20)
at Socket.emit (node:events:513: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)
If the connection is established without maxscale, directly to a db, there are no errors.
We already tried different versions of the nodejs connector, but no luck.