Failed to install microk8s using "snap install microk8s --classic"

Viewed 1908

When attempting to install the snap microk8s 1.19/stable on a Linux machine we got any of the following errors:

error: cannot perform the following tasks:
- Run configure hook of "microk8s" snap if present (run hook "configure":

or

 - Mount snap "microk8s" (1769) ([stop snap-microk8s-1769.mount] failed with exit status -1: *** stack smashing detected ***: terminated

or

+ /snap/microk8s/1769/kubectl --kubeconfig=/var/snap/microk8s/1769/credentials/client.config apply -f /var/snap/microk8s/1769/args/cni-network/cni.yaml
The connection to the server 127.0.0.1:16443 was refused - did you specify the right host or port?

or

- Fetch and check assertions for snap "microk8s" (1769) (cannot verify snap "microk8s", no matching signatures found)

We had microk8s previously installed but had removed it some time ago, just mentioning it in case this could help. I doubt it is something to do with previous remnants, we also did temporary disable the firewall just to be sure it is not a firewall issue.

1 Answers

Seems like it might be an issue with the latest branch (v1.19) or in some way related to your OS. I have deployed this on ubuntu (20.04) and v1.19 worked fine for me.

Installing version 1.18 with stable snap channel solved issue:

sudo snap install microk8s --classic --channel=1.18/stable

You may also want to try to update the microk8s:

sudo snap refresh microk8s --classic --channel=1.19/stable

Here`s more information how to check/use microk8s channels.

Related