snap revert and refresh forwards and backwards causes breakage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snappy |
Fix Released
|
Undecided
|
John Lenton |
Bug Description
Playing around with the snap revert command I managed to get snapd into a state that blocked a snap revert to a particular revision. Steps I took are:
jamie@goldstein:~$ snap list ubuntu-core
Name Version Rev Developer Notes
ubuntu-core 16.04.1 819 canonical -
jamie@goldstein:~$ sudo snap revert ubuntu-core
ubuntu-core reverted to 16.04.1
jamie@goldstein:~$ sudo snap revert ubuntu-core
error: cannot revert "ubuntu-core": no revision to revert to
jamie@goldstein:~$ snap list ubuntu-core
Name Version Rev Developer Notes
ubuntu-core 16.04.1 812 canonical -
jamie@goldstein:~$ sudo snap refresh --revision=819 ubuntu-core
error: cannot perform the following tasks:
- Remove snap "ubuntu-core" (819) from the system (internal error: cannot discard snap "ubuntu-core": still active)
jamie@goldstein:~$ sudo snap refresh ubuntu-core
74.93 MB / 74.93 MB [======
ubuntu-core (stable) 16.04.1 from 'canonical' upgraded
jamie@goldstein:~$ snap list ubuntu-core
Name Version Rev Developer Notes
ubuntu-core 16.04.1 423 canonical -
Notice the difference in Rev numbers, this looks like the channel information was lost i.e. I had edge installed (819) and the revert went back to stable (423)?
I then tried revert to see what it would do:
jamie@goldstein:~$ sudo snap revert ubuntu-core
ubuntu-core reverted to 16.04.1
jamie@goldstein:~$ snap list
Name Version Rev Developer Notes
ubuntu-core 16.04.1 812 canonical -
jamie@goldstein:~$ sudo snap refresh --revision=819 ubuntu-core
error: cannot refresh "ubuntu-core": snap not found
jamie@goldstein:~$ sudo snap refresh ubuntu-core --revision=812
error: cannot perform the following tasks:
- Copy snap "ubuntu-core" data (cannot copy "/var/snap/
jamie@goldstein:~$ sudo snap refresh --edge ubuntu-core
74.77 MB / 74.77 MB [======
ubuntu-core (edge) 16.04.1 from 'canonical' upgraded
jamie@goldstein:~$ snap list
Name Version Rev Developer Notes
ubuntu-core 16.04.1 826 canonical -
So in summary, I think there may be a couple of bugs there, happy to split them out if necessary or on the contrary, it may just be the same bug.
Changed in snappy: | |
assignee: | nobody → John Lenton (chipaca) |
Changed in snappy: | |
status: | New → Fix Committed |
Changed in snappy: | |
status: | Fix Committed → Fix Released |