Puzzling hooks/install: 53: snap: Permission denied

After upgrading a previous working snap within a lxc environment using --destructive-mode, using snapcraft 7.3.1, when I attempt to install locally, I get the following:

snap install --dangerous ./couchdb_3.3.1_amd64.snap

error: cannot perform the following tasks:

  • Run install hook of “couchdb” snap if present (run hook “install”: /snap/couchdb/x1/meta/hooks/install: 53: snap: Permission denied)

(I tried both on lxc 22.04 with core22, core20 and on lxc 20.04 with core20)

The file permissions, which had worked on previous craftings, do have the execution bit set.

root@cdb22:~/couchdb-pkg# ls -altr snap/hooks/ total 20 -rwxr-xr-x 3 root root 1809 Apr 14 15:50 post-refresh -rwxr-xr-x 3 root root 1896 Apr 14 15:50 install -rwxr-xr-x 3 root root 1672 Apr 14 15:50 configure drwxr-xr-x 2 root root 4096 Apr 14 15:50 . drwxr-xr-x 3 root root 4096 Apr 14 16:23 …


Well, what is in line 53 of your install hook (note that the error explicitly states a line number)

Ah, thanks, helpful.

Line 53 is executing snap couchdb set xxx=???.

I suppose snap set cannot be called from with-in a yet to be installed snap.


No, you need to usel snapctl but can also only set config options for the snap itself, not for other snaps.