Revert of classic snap

I have a classic snap installed, and two older revisions of it:

andreas@nsn7:~/git/packages/samba$ snap list --all git-ubuntu
Name        Version  Rev  Developer  Notes
git-ubuntu  0        206  nacc       disabled,classic
git-ubuntu  0        207  nacc       disabled,classic
git-ubuntu  0        209  nacc       classic

Because the current snap is broken, I decided to revert. Note I didn’t pass --classic:

andreas@nsn7:~/git/packages/samba$ snap revert --revision=207 git-ubuntu
git-ubuntu reverted to 0
andreas@nsn7:~/git/packages/samba$ snap list 
Name                 Version    Rev   Developer  Notes
asciinema            1.4.0      9     sabdfl     classic
canonical-livepatch  7          22    canonical  -
charm                2.2        15    charms     classic
core                 16-2.27.5  2774  canonical  core
git-ubuntu           0          207   nacc       classic
ubuntu-image         1.1+snap3  75    canonical  classic

Now the snap stopped working, with a lot of permission denied errors (see the pastebin for all of it):

09/01/2017 10:24:20 - ERROR:stderr: warning: unable to access '/home/andreas/.gitconfig': Permission denied
[ 5160.966933] audit: type=1400 audit(1504272252.972:92): apparmor="DENIED" operation="open" profile="snap.git-ubuntu.git-ubuntu" name="/home/andreas/.gitconfig" pid=32598 comm="git" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

Turns out it was reverted as a confined snap, not classic. The snap list output earlier above, after the revert, is saying it’s classic. That in itself is probably a bug.

The other bug would be that it allowed the revert without --classic to happen. I think it should either give the same kind of error you get when you try to install a classic snap without passing --classic, or it should assume --classic on its own, since the version you are reverting to, already installed previously, was a classic snap with classic confinement.

Last updated 1 year, 3 months ago. Help improve this document in the forum.