RuntimeError: Dba.get_cluster: Illegal mix of collations

Bug #1901771 reported by David Ames
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MySQL InnoDB Cluster Charm
Fix Released
Critical
David Ames
snap-mysql-shell
Fix Released
Critical
David Ames

Bug Description

Using the mysql-shell snap on Focal with MySQL 8.0.22-0ubuntu0.20.04.2 executing dba functions leads to the following error:

/snap/bin/mysqlsh --no-wizard --python -f /root/snap/mysql-shell/common/tmp_vl_x1jg.py
Logger: Tried to log to an uninitialized logger.
Traceback (most recent call last):
  File "<string>", line 5, in <module>
SystemError: RuntimeError: Dba.get_cluster: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8_general_ci,SYSCONST) for operation '='

The same interactively
/snap/bin/mysqlsh --no-wizard --python
Logger: Tried to log to an uninitialized logger.
MySQL Shell 8.0.21

Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
mysql-py> shell.connect()
Creating a session to 'clusteruser@10.5.0.10'
Fetching schema names for autocompletion... Press ^C to stop.
Your MySQL connection id is 334 (X protocol)
Server version: 8.0.22-0ubuntu0.20.04.2 (Ubuntu)
No default schema selected; type \use <schema> to set one.
<Session:clusteruser@10.5.0.10:33060>
mysql-py []> cluster = dba.get_cluster('jujuCluster')
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: RuntimeError: Dba.get_cluster: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8_general_ci,SYSCONST) for operation '='

From the perspective of the mysql-innodb-cluster charm this presents similar to LP Bug #1881735 [0] but these are distinct bugs.

It is unclear at this time if the problem is the MySQL8 packages (8.0.22-0ubuntu0.20.04.2) or the mysql-shell snap built on 8.0.21.

Testing with mysql-shell built on 8.0.22 next.

[0] https://bugs.launchpad.net/charm-mysql-innodb-cluster/+bug/1881735

Tags: cdo-qa
Revision history for this message
David Ames (thedac) wrote :

Testing a 8.0.22 build of the mysql-shell client.

8.0.22 requires boost 1.73.0 [0]

[0] https://code.launchpad.net/~snap-mysql-shell-developers/snap-mysql-shell/+git/snap-mysql-shell/+merge/392912

Revision history for this message
David Ames (thedac) wrote :

Confirmed. A manual rebuild of the mysql-shell snap on 8.0.22 [0] resolves the failure.

[0] https://code.launchpad.net/~snap-mysql-shell-developers/snap-mysql-shell/+git/snap-mysql-shell/+merge/392912

Changed in snap-mysql-shell:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → David Ames (thedac)
Changed in charm-mysql-innodb-cluster:
status: New → Invalid
Revision history for this message
David Ames (thedac) wrote :

Validated and promoted 8.0.22 mysql-shell snap to stable in the snap store.

Changed in snap-mysql-shell:
status: Confirmed → Fix Released
Revision history for this message
David Ames (thedac) wrote :

The mysql-shell was updated to 8.0.22 at approx 23:15 UTC 2020-10-27. I would expect failures prior to that and I would expect it is fixed for runs after that time.

Revision history for this message
David Ames (thedac) wrote :

We seem to have some knock-on effects from the update the mysql-shell. The restart after dba.configure_instance is exiting with:

2020-10-28 16:02:01 ERROR juju-log Failed configuring instance 172.20.0.22: Cannot set LC_ALL to locale en_US.UTF-8: No such file or directory
Configuring local MySQL instance listening at port 3306 for use in an InnoDB cluster...
This instance reports its own address as 172.20.0.22:3306
The instance '172.20.0.22:3306' is valid to be used in an InnoDB cluster.
The instance '172.20.0.22:3306' is already ready to be used in an InnoDB cluster.
Traceback (most recent call last):
  File "<string>", line 3, in <module>
mysqlsh.DBError: MySQL Error (2006): Session.run_sql: MySQL server has gone away

Fix on the way.

Changed in charm-mysql-innodb-cluster:
status: Invalid → Triaged
importance: Undecided → Critical
assignee: nobody → David Ames (thedac)
milestone: none → 20.10
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-mysql-innodb-cluster (master)

Fix proposed to branch: master
Review: https://review.opendev.org/760234

Changed in charm-mysql-innodb-cluster:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-mysql-innodb-cluster (master)

Reviewed: https://review.opendev.org/760234
Committed: https://git.openstack.org/cgit/openstack/charm-mysql-innodb-cluster/commit/?id=14d69d24113b572e9ddb5af08c1307a522e5d934
Submitter: Zuul
Branch: master

commit 14d69d24113b572e9ddb5af08c1307a522e5d934
Author: David Ames <email address hidden>
Date: Wed Oct 28 11:56:07 2020 -0700

    Do not RESTART after configure_instance

    After the mysql-shell update to 8.0.22 the shell.run_sql("RESTART") in
    configure_instance began exiting with non-zero and an error message
    stating the MySQL server has gone away.

    It seems the shell.run_sql("RESTART") is not necessary. This change
    removes this from the configure_instance method. It also adds a
    restart_instance method in case we need it in the future.

    Closes-Bug: #1901771
    Change-Id: I5f5278a4097e75c1a37e1880b594a1e81691249b

Changed in charm-mysql-innodb-cluster:
status: In Progress → Fix Committed
Changed in charm-mysql-innodb-cluster:
status: Fix Committed → Fix Released
tags: added: cdo-qa
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.