LXC cannot chroot to /var/lib/snapd/hostfs

When trying to run lxc this morning, snapd greeted me with an error:

$ lxc
chroot: cannot change root directory to '/var/lib/snapd/hostfs': Operation not permitted
$ snap version             
snap    2.28.1+git397.aad08ec~ubuntu16.04.1
snapd   2.28.1+git397.aad08ec~ubuntu16.04.1
series  16
ubuntu  17.10
kernel  4.13.0-11-generic

$ snap info lxd             
tracking:        stable
installed:       2.18 (4375) 41MB -
refreshed:       2017-10-03 21:11:24 +0200 CEST

I reported this to @stgraber on IRC a little while ago.

I see this too with r4375 (amd64). Reverting to r4279 (I’m on amd64) makes it work again.

It’s kinda weird because the chroot issue seems to only hit in some very limited cases. I’m yet to manage to reproduce it in our test environment.

That being said, I wrote a workaround for it which is landing now. Please refresh your LXD snap and let me know if this is still a problem.