pymysql.err.OperationalError: caching sha2: Unknown packet for public key: b'-'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-8.0 (Ubuntu) |
Fix Released
|
Critical
|
Unassigned | ||
Focal |
Fix Released
|
Critical
|
Unassigned | ||
Jammy |
Fix Released
|
Critical
|
Unassigned | ||
Kinetic |
Fix Released
|
Critical
|
Unassigned | ||
Lunar |
Fix Released
|
Critical
|
Unassigned | ||
openstack (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Focal |
Confirmed
|
Undecided
|
Unassigned | ||
Jammy |
Confirmed
|
Undecided
|
Unassigned | ||
Kinetic |
Won't Fix
|
Undecided
|
Unassigned | ||
Lunar |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
After upgrading and restarting both mysql-router (does not happen automatically) and mysql server (does happen automatically) to the new 8.0.32 version clients using the pymysql library and connecting via mysql-router will fail to connect with the following error:
pymysql.
8.0.32 was published into -security today (Jan 24th/25th). As a result both mysql-router and mysql-server get upgraded by unattended-
This does not happen on 8.0.31
This affects charmed openstack deployments on focal+jammy, database authentication doesn't work out of the box on new installs and fails on upgraded installs.
[Workaround]
Downgrade mysql-router to 8.0.31.
Note: You only need to downgrade the mysql-router package only - it does not cross-depend with any other mysql package. You cannot (and should not) downgrade the server packages as the 8.0.31 server cannot open data files upgraded to 8.0.32.
Focal (20.04) amd64: https:/
Jammy (22.04) amd64: https:/
Download and install the package, then restart the mysql-router service
apt install ./FILENAME.deb
systemctl restart \*-mysql-router
Alternatively:
Install the MySQL CLI and then manually connect to the server with each user/password combination in the environment. This will cache the password in the server's memory which triggers a different code path that avoids the issue.
If the MySQL server fails over or is restarted the cache is lost and clients will fail to connect again.
[Traceback]
Traceback (most recent call last):
File "/usr/lib/
return fn()
File "/usr/lib/
return _ConnectionFair
File "/usr/lib/
fairy = _ConnectionReco
File "/usr/lib/
rec = pool._do_get()
File "/usr/lib/
with util.safe_
File "/usr/lib/
compat.raise_(
File "/usr/lib/
raise exception
File "/usr/lib/
return self._create_
File "/usr/lib/
return _ConnectionReco
File "/usr/lib/
self.
File "/usr/lib/
with util.safe_
File "/usr/lib/
compat.raise_(
File "/usr/lib/
raise exception
File "/usr/lib/
self.
File "/usr/lib/
return dialect.
File "/usr/lib/
return self.dbapi.
File "/usr/lib/
self.connect()
File "/usr/lib/
self.
File "/usr/lib/
auth_packet = _auth.caching_
File "/usr/lib/
raise OperationalError(
pymysql.
Changed in mysql-8.0 (Ubuntu): | |
importance: | Undecided → Critical |
tags: | added: regression-update |
description: | updated |
description: | updated |
information type: | Public → Public Security |
description: | updated |
tags: | added: cdo-qa foundations-engine |
Status changed to 'Confirmed' because the bug affects multiple users.