Snap Install Microk8s Error

Hi All,

I am running Ubuntu 18.04 LTS and am trying to install microk8s using snap. When I type the command ‘sudo snap install microk8s --classic’ I get this error message

-----------------------------------------------------------------------------------------------------------------------
error: cannot perform the following tasks:
- Run install hook of "microk8s" snap if present (run hook "install": 
-----
+ export LD_LIBRARY_PATH=/snap/microk8s/826/lib:/snap/microk8s/826/usr/lib:/snap/microk8s/826/lib/x86_64-linux-gnu:/snap/microk8s/826/usr/lib/x86_64-linux-gnu
+ LD_LIBRARY_PATH=/snap/microk8s/826/lib:/snap/microk8s/826/usr/lib:/snap/microk8s/826/lib/x86_64-linux-gnu:/snap/microk8s/826/usr/lib/x86_64-linux-gnu
+ export PATH=/snap/microk8s/826/usr/sbin:/snap/microk8s/826/usr/bin:/snap/microk8s/826/sbin:/snap/microk8s/826/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/bin:/usr/local/bin
+ PATH=/snap/microk8s/826/usr/sbin:/snap/microk8s/826/usr/bin:/snap/microk8s/826/sbin:/snap/microk8s/826/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/bin:/usr/local/bin
+ source /snap/microk8s/826/actions/common/utils.sh
+ cp -r /snap/microk8s/826/default-args /var/snap/microk8s/826/args
/snap/microk8s/826/meta/hooks/install: line 10: /snap/microk8s/826/bin/cp: No such file or directory

Does anyone know how I would go about fixing it? I have been talking to the developers of Microk8s and they said that this may be a snap configuration issue so I wanted to ask here.

Thanks

What’s the output of the following command:

snap version

Is this a genuine local Ubuntu 18.04 LTS install, or a remote hosted machine provided by a 3rd party?

Snap version is 2.39.2+18.04 and this is a genuine local 18.04 LTS install as I downloaded it and installed it myself. Although the physical server is a 3rd party server as it has similar hardware as Nvidia but wasn’t purchased from Nvidia.

Can you snap list and if core18 is listed, and core is not then can you please snap install core then re-install the microk8s snap? snap remove microk8s then snap install microk8s --classic please.

Edit: Actually that’s unlikely to be it. I expect you do have core, right?

Hi Alan, when I run snap list I see core 16-2.41 version. Should I update that to core 18?

no, microk8s does not use a base: core18, no need to fiddle with that

Oh okay, well then I only have core version 16-2.41 version as the only installed item in snap list. And when I try to run install microk8s --classic again it failed.

what was the full output of snap version (can you copy/paste it) ?

snap 2.40+18.04
snapd 2.40+18.04
series 16
ubuntu 18.04
kernel 4.15.0-62-generic

hmm, this looks all fine …

you seem to be not alone though:

https://github.com/ubuntu/microk8s/issues/663

EDIT: LOL … ignore that, i just noticed you are the same person :slight_smile:

That’s actually me. They directed me here.

i can absolutely not repoduce this over here, nether on 18.04 nor on 16.04 … and as konstantinos said in the github issue, it doesnt really make any sense to fail like this (yet it does !!), the source dir exists inside the snap (in /snap/microk8s/826/) and the target dir is created before the install hook runs …

do you have any exotic filesystem setup by chance ?

No the only additional file system I have is /dev/md0 which I added. The issue I have is that /snap/microk8s directory does not exist and I don’t know why that is the case.

can you post the output of

$ SNAPD_DEBUG=1 snap install microk8s --classic

Here is the error message I get:

error: cannot perform the following tasks:
- Run install hook of "microk8s" snap if present (run hook "install": 
-----
+ export LD_LIBRARY_PATH=/snap/microk8s/826/lib:/snap/microk8s/826/usr/lib:/snap/microk8s/826/lib/x86_64-linux-gnu:/snap/microk8s/826/usr/lib/x86_64-linux-gnu
+ LD_LIBRARY_PATH=/snap/microk8s/826/lib:/snap/microk8s/826/usr/lib:/snap/microk8s/826/lib/x86_64-linux-gnu:/snap/microk8s/826/usr/lib/x86_64-linux-gnu
+ export PATH=/snap/microk8s/826/usr/sbin:/snap/microk8s/826/usr/bin:/snap/microk8s/826/sbin:/snap/microk8s/826/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/bin:/usr/local/bin
+ PATH=/snap/microk8s/826/usr/sbin:/snap/microk8s/826/usr/bin:/snap/microk8s/826/sbin:/snap/microk8s/826/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/bin:/usr/local/bin
+ source /snap/microk8s/826/actions/common/utils.sh
+ cp -r /snap/microk8s/826/default-args /var/snap/microk8s/826/args
/snap/microk8s/826/meta/hooks/install: line 10: /snap/microk8s/826/bin/cp: No such file or directory
-----)

And when I look at journalctl for snapd here is the error message I get:

Sep 24 17:50:25 dls1 snapd[29684]: api.go:950: Installing snap "microk8s" revision unset
Sep 24 17:50:29 dls1 snapd[29684]: link.go:111: cannot update fontconfig cache: cannot get fc-cache-v6 from core: open /snap/core/current/bin/fc-cache-v6: n
Sep 24 17:50:30 dls1 snapd[29684]: handlers.go:459: Reported install problem for "microk8s" as already-reported
Sep 24 18:07:53 dls1 snapd[29684]: daemon.go:203: polkit error: Authorization requires interaction
Sep 24 18:07:57 dls1 snapd[29684]: api.go:950: Installing snap "core18" revision unset
Sep 24 18:08:00 dls1 snapd[29684]: link.go:111: cannot update fontconfig cache: cannot get fc-cache-v6 from core: open /snap/core/current/bin/fc-cache-v6: n
Sep 24 18:08:39 dls1 snapd[29684]: api.go:950: Installing snap "microk8s" revision unset
Sep 24 18:08:42 dls1 snapd[29684]: link.go:111: cannot update fontconfig cache: cannot get fc-cache-v6 from core: open /snap/core/current/bin/fc-cache-v6: n
Sep 24 18:08:44 dls1 snapd[29684]: handlers.go:459: Reported install problem for "microk8s" as already-reported
Sep 24 19:15:26 dls1 snapd[29684]: api.go:950: Installing snap "microk8s" revision unset
Sep 24 19:15:30 dls1 snapd[29684]: link.go:111: cannot update fontconfig cache: cannot get fc-cache-v6 from core: open /snap/core/current/bin/fc-cache-v6: n
Sep 24 19:15:32 dls1 snapd[29684]: handlers.go:459: Reported install problem for "microk8s" as already-reported
Sep 24 19:46:20 dls1 snapd[29684]: daemon.go:203: polkit error: Authorization requires interaction
Sep 24 19:46:25 dls1 snapd[29684]: api.go:950: Installing snap "microk8s" revision unset
Sep 24 19:46:29 dls1 snapd[29684]: link.go:111: cannot update fontconfig cache: cannot get fc-cache-v6 from core: open /snap/core/current/bin/fc-cache-v6: n
Sep 24 19:46:30 dls1 snapd[29684]: handlers.go:459: Reported install problem for "microk8s" as already-reported
Sep 24 19:47:57 dls1 snapd[29684]: api.go:950: Installing snap "microk8s" revision unset
Sep 24 19:48:01 dls1 snapd[29684]: link.go:111: cannot update fontconfig cache: cannot get fc-cache-v6 from core: open /snap/core/current/bin/fc-cache-v6: n
Sep 24 19:48:02 dls1 snapd[29684]: handlers.go:459: Reported install problem for "microk8s" as already-reported

if an install hook fails, the whole snap gets removed again so you wont find that dir after the failure … you can log in via a second terminal and run something like watch -d ls -l /snap and you should see the dir being created (and removed again) during the install attempt (the same should be true for watching /var/snap).

this line seems to be cutoff, can you run

$ journalctl -e --no-pager -u snapd

and paste the results here?

also for future reference, it’s much more readable if you put triple backticks (i.e. ```) above the output and below it so it creates a code block.

Sep 24 21:09:11 dls1 snapd[29684]: api.go:950: Installing snap "microk8s" revision unset
Sep 24 21:09:15 dls1 snapd[29684]: link.go:111: cannot update fontconfig cache: cannot get fc-cache-v6 from core: open /snap/core/current/bin/fc-cache-v6: no such file or directory
Sep 24 21:09:17 dls1 snapd[29684]: handlers.go:459: Reported install problem for "microk8s" as already-reported

This was the error message I got. And thanks! I didn’t realize that the website goes with css format for that, as I am used to doing it for discord

have you been able to install any other snaps, such as hello-world? if you haven’t already try doing:

$ SNAPD_DEBUG=1 snap install hello-world

Also what does

$ snap debug confinement

and

$ cat /proc/self/mountinfo

show on your system?

I was able to install hello-world, core18, and snappy-debug onto the system without any issues.

And when I type in

snap debug confinement

my output is

strict

and when I type in

cat /proc/self/mountinfo

Edited: The link for it is here