snap refresh fails when upgrading Charm from 1.7/stable to 1.8/stable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vault-charm |
New
|
Undecided
|
Unassigned |
Bug Description
Environment :
Ubuntu : Jammy 22.04
Juju : 2.9.42
MaaS : 3.3
Original channel of Vault : 1.7/stable
Openstack : Yoga
Vault is providing the CA certificate and all certificates to related units.
When running :
juju refresh vault --channel 1.8/stable
The Vault unit are staying in Active / executing state with the error seeing below :
ubuntu@maas:~$ juju status vault
Model Controller Cloud/Region Version SLA Timestamp
yoga juju-default juju/default 2.9.42 unsupported 04:25:17Z
App Version Status Scale Charm Channel Rev Exposed Message
vault 1.7.9 active 1 vault 1.8/stable 108 no Unit is ready (active: true, mlock: disabled)
vault-mysql-router 8.0.33 active 1 mysql-router 8.0/stable 35 no Unit is ready
Unit Workload Agent Machine Public address Ports Message
vault/0* active executing 0/lxd/12 192.168.29.143 8200/tcp (upgrade-charm) Unit is ready (active: true, mlock: disabled)
vault-
2023-06-06 04:28:14 WARNING unit.vault/
2023-06-06 04:28:15 INFO unit.vault/
2023-06-06 04:28:15 INFO unit.vault/
2023-06-06 04:28:15 INFO unit.vault/
2023-06-06 04:28:15 ERROR unit.vault/
Traceback (most recent call last):
File "/var/lib/
bus.
File "/var/lib/
_invoke(
File "/var/lib/
handler.
File "/var/lib/
self.
File "/var/lib/
snap.
File "/var/lib/
_refresh_
File "/var/lib/
out = subprocess.
File "/usr/lib/
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/
raise CalledProcessEr
subprocess.
When running manually the snap refresh, snap will complain Vault is currently running and should be stopped before refreshing the snap :
ubuntu@
error: cannot refresh "vault": snap "vault" has running apps (vault), pids: 44110
The charm should preemptively attempt to stop Vault service first before refreshing the snap itself.
Current manual workaround is to stop Vault snap and then refresh it (or let the charm re-attempt the refresh) :
$ sudo systemctl stop vault
$ sudo snap refresh vault --channel 1.8/stable
This might be related to the issue #2008760 and partially related to #2007587