Snap installation of microk8s fails when juju snap is also installed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Yang Kelvin Liu |
Bug Description
I am trying to install microk8s after having installed juju latest/candidate. The installation fails with this error message:
$ sudo snap install microk8s --classic
error: cannot perform the following tasks:
- Run hook connect-plug-peers of snap "juju" (run hook "connect-
-----
error: error running snapctl: cannot perform the following tasks:
- start of [juju.fetch-oci] (# systemctl start snap.juju.
Job for snap.juju.
See "systemctl status snap.juju.
)
- start of [juju.fetch-oci] (exit status 1)
-----)
Checking the logs from journalctl, I see these lines:
Jun 02 09:27:15 cat systemd[1]: Starting Service for snap application juju.fetch-oci...
Jun 02 09:27:15 cat juju.fetch-
Jun 02 09:27:15 cat juju.fetch-
Jun 02 09:27:15 cat juju.fetch-
Jun 02 09:27:15 cat juju.fetch-
Jun 02 09:27:15 cat juju.fetch-
Jun 02 09:27:15 cat systemd[1]: snap.juju.
Jun 02 09:27:15 cat systemd[1]: snap.juju.
Jun 02 09:27:15 cat systemd[1]: Failed to start Service for snap application juju.fetch-oci.
I'm opening this issue in Juju's bug tracker because I checked that file, and those lines haven't been changed since 2019, whereas this installation error started happening recently.
Changed in juju: | |
status: | Fix Committed → Fix Released |
Changed in juju: | |
status: | Triaged → In Progress |
Changed in juju: | |
status: | Fix Committed → Fix Released |
It seems the issue here is that the user cannot run microk8s because they are not in the microk8s group.
https:/ /github. com/ubuntu/ microk8s/ blob/master/ microk8s- resources/ actions/ common/ utils.sh# L7
So microk8s is not operational and the juju snap hook exits 1.
We'll land a tweak to the juju snap hook to always exit 0 so that even if there's an issue, it won't block anything. After all, it's just an optimisation that is being done.