sidorares / sidorares/node-mysql2

Server requires auth switch, but no auth switch handler provided

Open
#504 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

As per http://stackoverflow.com/questions/41941663/server-requires-auth-switch-but-no-auth-switch-handler-provided and https://github.com/mysqljs/mysql/issues/1396

This error did not occur on our test mysql server, but it does occur on the production one.

When adding the authSwitchHandler as suggested the only thing that gets printed is { pluginName: '', pluginData: <Buffer > }
Doesn't seem very helpful.
debug: true added a whole load of stuff, some of which follows (redacted in case hex strings contains credentials:

Add command: Connection
Add command: Connection
 raw: <redacted>
2 undefined ==> Connection#handshakeInit(0,,60)
Server hello packet: capability flags:41516=(long flag, connect with db, compress, protocol 41, transactions, secure connection)
Sending handshake packet: flags:8582095=(long password, found rows, long flag, connect with db, odbc, local files, ignore space, protocol 41, ignore sigpipe, transactions, reserved, secure connection, multi results, session track)
2 59003828 <== Connection#handshakeInit(1,,79)
2 59003828 <== <redacted>
 raw: <redacted>
1 undefined ==> Connection#handshakeInit(0,,60)
Server hello packet: capability flags:41516=(long flag, connect with db, compress, protocol 41, transactions, secure connection)
Sending handshake packet: flags:8582095=(long password, found rows, long flag, connect with db, odbc, local files, ignore space, protocol 41, ignore sigpipe, transactions, reserved, secure connection, multi results, session track)
1 59003827 <== Connection#handshakeInit(1,,79)
1 59003827 <== <redacted>
Add command: Connection
 raw: fe
2 59003828 ==> Connection#handshakeResult(2,EOF,5)
Request ended
 raw: fe
1 59003827 ==> Connection#handshakeResult(2,EOF,5)
 raw: <redacted>
3 undefined ==> Connection#handshakeInit(0,,60)
Server hello packet: capability flags:41516=(long flag, connect with db, compress, protocol 41, transactions, secure connection)
Sending handshake packet: flags:8582095=(long password, found rows, long flag, connect with db, odbc, local files, ignore space, protocol 41, ignore sigpipe, transactions, reserved, secure connection, multi results, session track)
3 59003829 <== Connection#handshakeInit(1,,79)
3 59003829 <== <redacted>
 raw: fe
3 59003829 ==> Connection#handshakeResult(2,EOF,5)

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 by reading the linked Stack Overflow question and mysqljs/mysql issue 1396, then trace the connection handshake and authSwitchHandler behavior discussed in this report. No repository file or test is named, so locate the relevant handshake code and add a reproducible test for the server response. Done means the production authentication switch is handled or reported with useful plugin information.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, node.js, typescript
Domain
backend, 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.