I have narrowed this down to.. when you connect via mysql-router only, on 127.0.0.1 (TCP)
The code at /usr/lib/python3/dist-packages/pymysql/_auth.py:254 in caching_sha2_password_auth expects to receive 0x01 (checked by pkt.is_extra_auth_data) and then the public key. Instead it's received 0x2D.. and then the same public key. This causes the code there to error out.
I have not yet figured out why it's getting 0x2D or what that means.
08:47:03.952527 line 254 if not conn.server_public_key:
08:47:03.952638 line 255 pkt = _roundtrip(conn, b'\x02') # Request public key
08:47:03.953153 line 256 print(hex(pkt._data[0]))
0x2d
08:47:03.953290 line 257 print(pkt._data.decode('ascii'))
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkrOn8+wodDNTomkEa2jT
t6YIXXSwX9MEWnwEdXiSwCk3LW46l881lg7N1yox3KtgjrNn6X1aeHUGzrDcTGy+
Sz5ErhJZzWoHLMDt6IAfgPswgrH89NUkKadHTyk02E+fV4UL4k9LGDg6pYAdLU1w
EqGUCiugoQ6YNh8JAhfk3Y+haP1mhoN5JseoYvOc0o/D4R3nEOMl+a2JyNrwOVqq
JW5Z1Rxa9eByd/yjb+Hix5jNZf2S65J6i9zbDweSl06rS3EQXEc0k6mxpBhPMxkM
R9nbO86pD0yc1JUbwDam1nLXod2hzoHzHBUbbOQ4HDK+7nQ8VAZv2zG+j7tx8s0l
2wIDAQAB
-----END PUBLIC KEY-----
08:47:03.953448 line 258 if not pkt.is_extra_auth_data():
08:47:03.953534 line 259 raise OperationalError(
08:47:03.953607 line 260 "caching sha2: Unknown packet for public key: %s" % pkt._data[:1]
08:47:03.953683 line 259 raise OperationalError(
08:47:03.953757 exception 259 raise OperationalError(
Exception:..... pymysql.err.OperationalError: caching sha2: Unknown packet for public key: b'-'
Call ended by exception
I have narrowed this down to.. when you connect via mysql-router only, on 127.0.0.1 (TCP)
The code at /usr/lib/ python3/ dist-packages/ pymysql/ _auth.py: 254 in caching_ sha2_password_ auth expects to receive 0x01 (checked by pkt.is_ extra_auth_ data) and then the public key. Instead it's received 0x2D.. and then the same public key. This causes the code there to error out.
I have not yet figured out why it's getting 0x2D or what that means.
Likely candidate upstream commits: /github. com/mysql/ mysql-server/ commit/ e31f9f26e26d428 a577deb9b0b9d07 f652045ccb
https:/
"Bug#34778017 authenticating over unix-socket fails"
https:/ /github. com/mysql/ mysql-server/ commit/ 099e4529acc4665 7b887961ae590b8 090ff2c1fc password_ auth_client_ nonblocking"
"Bug#34556764: Contribution by Facebook: Fix sha256_
08:47:03.952527 line 254 if not conn.server_ public_ key: pkt._data[ 0])) _data.decode( 'ascii' )) G9w0BAQEFAAOCAQ 8AMIIBCgKCAQEAk rOn8+wodDNTomkE a2jT EdXiSwCk3LW46l8 81lg7N1yox3Ktgj rNn6X1aeHUGzrDc TGy+ t6IAfgPswgrH89N UkKadHTyk02E+ fV4UL4k9LGDg6pY AdLU1w JAhfk3Y+ haP1mhoN5JseoYv Oc0o/D4R3nEOMl+ a2JyNrwOVqq yjb+Hix5jNZf2S6 5J6i9zbDweSl06r S3EQXEc0k6mxpBh PMxkM bwDam1nLXod2hzo HzHBUbbOQ4HDK+ 7nQ8VAZv2zG+ j7tx8s0l
08:47:03.952638 line 255 pkt = _roundtrip(conn, b'\x02') # Request public key
08:47:03.953153 line 256 print(hex(
0x2d
08:47:03.953290 line 257 print(pkt.
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhki
t6YIXXSwX9MEWnw
Sz5ErhJZzWoHLMD
EqGUCiugoQ6YNh8
JW5Z1Rxa9eByd/
R9nbO86pD0yc1JU
2wIDAQAB
-----END PUBLIC KEY-----
08:47:03.953448 line 258 if not pkt.is_ extra_auth_ data(): err.Operational Error: caching sha2: Unknown packet for public key: b'-'
08:47:03.953534 line 259 raise OperationalError(
08:47:03.953607 line 260 "caching sha2: Unknown packet for public key: %s" % pkt._data[:1]
08:47:03.953683 line 259 raise OperationalError(
08:47:03.953757 exception 259 raise OperationalError(
Exception:..... pymysql.
Call ended by exception