sidorares / sidorares/node-mysql2

Warning: got packets out of order. Expected 1 but received 28

Open
#528 28 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

I am trying to create a MySQL server using node-mysql2, but I am getting the following errors:

Warning: got packets out of order. Expected 1 but received 28
Warning: got packets out of order. Expected 2 but received 29
Warning: got packets out of order. Expected 3 but received 30
Warning: got packets out of order. Expected 4 but received 31
Warning: got packets out of order. Expected 5 but received 32
[ [ TextRow { '1': 1 } ],
  [ { catalog: 'def',
      schema: '',
      name: '1',
      orgName: '',
      table: '',
      orgTable: '',
      characterSet: 63,
      columnLength: 1,
      columnType: 8,
      flags: 129,
      decimals: 0 } ] ]

This is the server initialization code, https://github.com/gajus/seeql/blob/fb615713a6fe3b856c543d2dd5e27286ba3e665a/src/index.js#L135-L142.

connection.serverHandshake({
  capabilityFlags: 0xffffff,
  characterSet: 8,
  connectionId: connectionId++,
  protocolVersion: 10,
  serverVersion: '5.6.10',
  statusFlags: 2
});

What am I missing?

Using Node.js v7.7.1.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the server initialization in src/index.js at lines 135-142, especially the serverHandshake call, and trace how node-mysql2 processes the resulting packets. Reproduce the warnings with the shown Node.js v7.7.1 setup and compare the expected and received packet sequences. Done means identifying the handshake mismatch and documenting the required change or configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, node.js
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.