I’m trying to migrate from the ppa to snap on Ubuntu artful. After installing the snap, running lxd init results in the following error: “error: Unable to talk to LXD: Get http://unix.socket/1.0: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: no such file or directory”
Performing a snap logs lxd shows the following:
2017-12-03T21:28:16Z lxd.daemon[30037]: /snap/lxd/5061/wrappers/daemon.start: 21: .: Can't open /var/snap/lxd/common/config
2017-12-03T21:28:16Z systemd[1]: snap.lxd.daemon.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
2017-12-03T21:28:16Z systemd[1]: snap.lxd.daemon.service: Unit entered failed state.
2017-12-03T21:28:16Z systemd[1]: snap.lxd.daemon.service: Failed with result 'exit-code'.
2017-12-03T21:28:16Z systemd[1]: snap.lxd.daemon.service: Service hold-off time over, scheduling restart.
2017-12-03T21:28:16Z systemd[1]: Stopped Service for snap application lxd.daemon.
2017-12-03T21:28:16Z systemd[1]: snap.lxd.daemon.service: Start request repeated too quickly.
2017-12-03T21:28:16Z systemd[1]: Failed to start Service for snap application lxd.daemon.
2017-12-03T21:28:16Z systemd[1]: snap.lxd.daemon.service: Unit entered failed state.
2017-12-03T21:28:16Z systemd[1]: snap.lxd.daemon.service: Failed with result 'exit-code'.
Regards reinstalling a snap, the inability to reinstall - or force reinstall - meant I lost the data in any case (fortunately it was a development machine) I just had a lot more investigative work to figure out what to clean out.
While I understand the move to snaps, the fact that there is no real means - that I know of - of fixing a corrupted snap gives me pause about going to snaps for production/important machines.
Regards, the PATH, I imagine the problem is that I use zsh and so the hook didn’t do anything. It might be worthwhile specifying in the documentation that /snap/bin needs to be on the path. Not being familiar with snap it took me some googling to figure out where the binaries were.
All the data from the snap is accessible through /var/snap/lxd (mostly in /var/snap/lxd/common/lxd). If necessary, this can be manually backed up and restored as was /var/lib/lxd with the deb.
The snap content itself is in /snap/lxd/current/ and we have a number of snap set options to tweak the behavior of the snap (see LXD snap: Call for testing).
We also have a mechanism in place to sideload a manually built/debug lxd binary onto a snap install, so that we can distribute emergency fixes or capture extra debug information.