Fail to upgrade mysql-router charm from version #6 to #8
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Router Charm |
Fix Released
|
High
|
Alex Kavanagh |
Bug Description
mysql-router charm fails to upgrade when there is a customized "cluster-name" defined on charm mysql-innodb-
Openstack version Victoria
Log error:
2021-05-04 18:09:57 INFO juju-log Invoking reactive handler: reactive/
2021-05-04 18:09:57 INFO juju-log Invoking reactive handler: reactive/
2021-05-04 18:09:57 ERROR juju-log Hook error:
Traceback (most recent call last):
File "/var/lib/
bus.
File "/var/lib/
_invoke(
File "/var/lib/
handler.
File "/var/lib/
self.
File "/var/lib/
instance.
File "lib/charm/
self.
File "lib/charm/
config[
File "/usr/lib/
raise KeyError(key)
KeyError: 'metadata_
2021-05-04 18:09:57 WARNING upgrade-charm Traceback (most recent call last):
2021-05-04 18:09:57 WARNING upgrade-charm File "/var/lib/
2021-05-04 18:09:57 WARNING upgrade-charm main()
2021-05-04 18:09:57 WARNING upgrade-charm File "/var/lib/
2021-05-04 18:09:57 WARNING upgrade-charm bus.dispatch(
2021-05-04 18:09:57 WARNING upgrade-charm File "/var/lib/
2021-05-04 18:09:57 WARNING upgrade-charm _invoke(
2021-05-04 18:09:57 WARNING upgrade-charm File "/var/lib/
2021-05-04 18:09:57 WARNING upgrade-charm handler.invoke()
2021-05-04 18:09:57 WARNING upgrade-charm File "/var/lib/
2021-05-04 18:09:57 WARNING upgrade-charm self._action(*args)
2021-05-04 18:09:57 WARNING upgrade-charm File "/var/lib/
2021-05-04 18:09:57 WARNING upgrade-charm instance.
2021-05-04 18:09:57 WARNING upgrade-charm File "lib/charm/
2021-05-04 18:09:57 WARNING upgrade-charm self.update_
2021-05-04 18:09:57 WARNING upgrade-charm File "lib/charm/
2021-05-04 18:09:57 WARNING upgrade-charm config[
2021-05-04 18:09:57 WARNING upgrade-charm File "/usr/lib/
2021-05-04 18:09:57 WARNING upgrade-charm raise KeyError(key)
2021-05-04 18:09:57 WARNING upgrade-charm KeyError: 'metadata_
2021-05-04 18:09:57 ERROR juju.worker.
It seems that the cluster name does not match:
https:/
https:/
so the configparser failure with the keyerror when it tries to update the config.
https:/
tags: | added: charm-upgrade |
Changed in charm-mysql-router: | |
milestone: | none → 21.10 |
Changed in charm-mysql-router: | |
status: | Fix Committed → Fix Released |
Changed in charm-mysql-router: | |
status: | Fix Released → New |
Changed in charm-mysql-router: | |
milestone: | 21.10 → none |
Changed in charm-mysql-router: | |
status: | Confirmed → Fix Released |
Yup, the issue is in this code:
config = configparser. ConfigParser( )
config. read(self. mysqlrouter_ conf) heading] .keys() :
config[ heading] [param] = parameters[ heading] [param]
for heading in parameters.keys():
for param in parameters[
During charm-upgrade, the charm may have introduced new headings which didn't exist in the old version of the charm. Thus, the above code would break on the config[heading] dict-like object not having the heading.
Going to work on a fix.