Error installing LXD from a local snap

Due to stability reasons I’m installing LXD from local snaps so that they’re not automatically refreshed from a remote channel.

The process looks like the following:

$ snap remove lxd
$ snap download lxd --channel=4.0/stable
$ snap install lxd_22753.snap --dangerous

However recently I have run into an issue installing LXD in the same way on new servers:

$ sudo snap remove
$ snap download lxd --channel=4.0/stable
$ snap install lxd_22753.snap --dangerous
error: cannot perform the following tasks:
- Run configure hook of "lxd" snap if present (run hook "configure": 
-----
cat: /proc/self/attr/current: Permission denied
/snap/lxd/x1/snap/hooks/configure: 5: exec: aa-exec: Permission denied
-----)

This issue is reproducible on both a physical server and on a VM.

Any ideas as to why this happens? I found the same error in this bug thread however LXD is already installed in this scenario.

That looks like snapd not connecting the lxd-support interface which is required for the LXD snap. This is likely normal as that interface never auto-connects for security reasons.

The snap download should also download the store assertion which you should be able to snap ack or something like that so when installing the LXD snap, you do get things connected.

Thanks for the feedback, I am not executing snap ack as it would make the installed snap track a remote snap channel, making it eventually refresh automatically.

I have tried to snap ack the assertion before install on a test machine, however the issue still persists:

image

Okay. Then I’d recommend you bring this up at https://forum.snapcraft.io as it’s not something we have any control over.

1 Like

I copied a local LXD snap from a server installation we did 2 months ago to the new local server, this snap has LXD version 4.0.8 and seems to install fine with or without the ack. Could this issue be due to the updated LXD version? I will create a thread over at snap nevertheless.

Yes, recent snap builds require the lxd-support interface even for the configure hook which is run at install time. So that will cause this behavior for you but it’s not anything that we can improve on our side.

What you need is a way to have those interfaces connected at installation time.

1 Like

I found that using --devmode with snap install worked, although it comes with caveats:

https://snapcraft.io/docs/install-modes#heading--developer

You can also do:

snap install lxd --edge # This installs the interfaces from the snapstore
snap install ./lxd.custom.snap --dangerous # Refresh to your custom snap and keep the interfaces
snap alias lxd.lxc lxc