mysql-innodb-cluster unit fails when grant does not exist for host

Bug #1996219 reported by Bas de Bruijne
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL InnoDB Cluster Charm
Triaged
High
Unassigned

Bug Description

In test run https://solutions.qa.canonical.com/v2/testruns/48b95cac-f227-4474-8935-6d44d6bdc9e7, mysql-innodb-cluster fails with the error:

```
unit-mysql-innodb-cluster-2: 07:08:09 DEBUG unit.mysql-innodb-cluster/2.juju-log db-router:58: Grant does NOT exist for host '192.168.33.171' on db 'barbican'
unit-mysql-innodb-cluster-2: 07:08:09 ERROR unit.mysql-innodb-cluster/2.juju-log db-router:58: Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-mysql-innodb-cluster-2/.venv/lib/python3.10/site-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-mysql-innodb-cluster-2/.venv/lib/python3.10/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-mysql-innodb-cluster-2/.venv/lib/python3.10/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-mysql-innodb-cluster-2/.venv/lib/python3.10/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-mysql-innodb-cluster-2/charm/reactive/mysql_innodb_cluster_handlers.py", line 340, in db_router_respond
    if instance.create_databases_and_users(db_router):
  File "/var/lib/juju/agents/unit-mysql-innodb-cluster-2/charm/lib/charm/openstack/mysql_innodb_cluster.py", line 1309, in create_databases_and_users
    allowed_units = self.get_allowed_units(
  File "/var/lib/juju/agents/unit-mysql-innodb-cluster-2/charm/lib/charm/openstack/mysql_innodb_cluster.py", line 1262, in get_allowed_units
    allowed_units = db_helper.get_allowed_units(
  File "/var/lib/juju/agents/unit-mysql-innodb-cluster-2/.venv/lib/python3.10/site-packages/charmhelpers/contrib/database/mysql.py", line 456, in get_allowed_units
    hosts = [settings['private-address']]
KeyError: 'private-address'
```

The source problem is a juju bug (LP: #1996218) but this should not put the cluster into an error state.

Logs and crashdumps can be found here:
https://oil-jenkins.canonical.com/artifacts/48b95cac-f227-4474-8935-6d44d6bdc9e7/index.html

Revision history for this message
Felipe Reyes (freyes) wrote :

Based on https://bugs.launchpad.net/juju/+bug/1996218/comments/1 , I'm marking this as triaged and high, since a missing "private-address" is part of "data not ready yet" state and the charm needs to handle this gracefully.

Changed in charm-mysql-innodb-cluster:
importance: Undecided → High
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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