The deferral of snap installation to ``layer-snap`` makes the charm susceptible to hook execution error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL InnoDB Cluster Charm |
Fix Released
|
High
|
Unassigned | ||
Snap Layer |
Fix Committed
|
Undecided
|
Unassigned | ||
charm-octavia-diskimage-retrofit |
Fix Released
|
High
|
Unassigned | ||
vault-charm |
Fix Released
|
High
|
Unassigned |
Bug Description
We consume ``layer-snap`` for our snap installation needs. The default behaviour of the layer appears to be fragile in the event of snap installation failure.
A failure could occur due to temporary network error or other environmental issues.
We can keep using the layer for our snap installation needs but we should probably take charge and call the library functions from the charm code instead of using the layer default mode of operation.
Log excerpt from failure:
2019-08-09 12:35:17 INFO juju-log Initializing Snap Layer
2019-08-09 12:35:17 DEBUG install none
2019-08-09 12:35:19 INFO juju-log Installing octavia-
2019-08-09 12:35:47 ERROR juju-log Hook error:
Traceback (most recent call last):
File "/var/lib/
hookenv.
File "/var/lib/
callback(*args, **kwargs)
File "/var/lib/
snap.
File "lib/charms/
_install_
File "lib/charms/
out = subprocess.
File "/usr/lib/
**kwargs)
File "/usr/lib/
output=stdout, stderr=stderr)
subprocess.
2019-08-09 12:35:47 DEBUG install Traceback (most recent call last):
2019-08-09 12:35:47 DEBUG install File "/var/lib/
2019-08-09 12:35:47 DEBUG install main()
2019-08-09 12:35:47 DEBUG install File "/var/lib/
2019-08-09 12:35:47 DEBUG install hookenv.
2019-08-09 12:35:47 DEBUG install File "/var/lib/
2019-08-09 12:35:47 DEBUG install callback(*args, **kwargs)
2019-08-09 12:35:47 DEBUG install File "/var/lib/
2019-08-09 12:35:47 DEBUG install snap.install(
2019-08-09 12:35:47 DEBUG install File "lib/charms/
2019-08-09 12:35:47 DEBUG install _install_
2019-08-09 12:35:47 DEBUG install File "lib/charms/
2019-08-09 12:35:47 DEBUG install out = subprocess.
2019-08-09 12:35:47 DEBUG install File "/usr/lib/
2019-08-09 12:35:47 DEBUG install **kwargs).stdout
2019-08-09 12:35:47 DEBUG install File "/usr/lib/
2019-08-09 12:35:47 DEBUG install output=stdout, stderr=stderr)
2019-08-09 12:35:47 DEBUG install subprocess.
2019-08-09 12:35:47 ERROR juju.worker.
Related branches
- Stuart Bishop: Approve
-
Diff: 75 lines (+29/-8)1 file modifiedlib/charms/layer/snap.py (+29/-8)
summary: |
The deferral of snap installation to ``layer-snap`` makes the charm - susceptible for hook execution error + susceptible to hook execution error |
Changed in charm-octavia-diskimage-retrofit: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in vault-charm: | |
milestone: | none → 19.10 |
Changed in vault-charm: | |
milestone: | 19.10 → 20.01 |
Changed in vault-charm: | |
milestone: | 20.01 → 20.05 |
Changed in vault-charm: | |
milestone: | 20.05 → 20.08 |
Changed in vault-charm: | |
status: | Confirmed → Triaged |
Changed in vault-charm: | |
milestone: | 20.08 → none |
Changed in layer-snap: | |
status: | In Progress → Fix Committed |
assignee: | Aurelien Lourot (aurelien-lourot) → nobody |
Adding ``snap-layer`` to the bug.
1) The information logged on error is insufficient to provide RCA
2) There probably are more robust ways of handling temporary snap install failures in the layer default mode of operation