Snap disable-enable breaks microk8s or containerd on host
Summary
When disabling & re-enabling microk8s 2-3 times in a row without otherwise changing the OS/services, it seems to cause issues with containerd service and/or breaking microk8s itself. Uninstalling microk8s doesn't fix the error below.
"containerd: failed to load TOML from /etc/containerd/config.toml: invalid disabled plugin URI "cri" expect io.containerd.x.vx
systemd[1]: containerd.service: Main process exited, code=exited, status=1/FAILURE"In previous tests, microk8s would just error out when I try to enable its snap package after rebooting. But removing and re-adding microk8s snap package fixed the error.
rror: cannot perform the following tasks: - Start snap "microk8s" (8474) services (systemctl command [start snap.microk8s.daemon-containerd.service] failed with exit status 1: stderr: Job for snap.microk8s.daemon-containerd.service failed because the control process exited with error code. See "systemctl status snap.microk8s.daemon-containerd.service" and "journalctl -xeu snap.microk8s.daemon-containerd.service" for details.)What Should Happen Instead?
I should be able to disable/enable microk8s without breaking microk8s, Docker or related services on my system.
Reproduction Steps
Errors above are easily reproducible.
- Created new VM
- Clean install of snap and microk8s
sudo -E snap install microk8s --classic --channel=1.32/stable- Disable microk8s snap
- Reboot and try to re-enable
- Rinse and repeat ~2-3 times
Please note, apt-get remove --purge of containerd and docker packages is insufficient. I had to wipe out the docker volume (/var/lib/docker) then reinstall to fix Docker. This is the 1st time I've done this explicitly in years which implies microk8s is definitely not isolated to it's own snap directory.
Introspection Report
N/A
Can you suggest a fix?
Perhaps microk8s should better isolate changes to its own containerd service and/or have a reliable rollback when uninstalling.
Likewise if snap disable is not a supported use case, it should warn the user and/or document this limitation.
Are you interested in contributing with a fix?
Source: canonical/microk8s