Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-4652

strange connection issues with nodejs connector and maxscale

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Not a Bug
    • 2.5.26
    • N/A
    • N/A
    • 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)

      { sqlMessage: "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:[]", fatal: false, errno: 1927, sqlState: 'HY000', code: 'ER_CONNECTION_KILLED' }

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Ferchland Felix
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.