snap revert and refresh forwards and backwards causes breakage

Bug #1630652 reported by Jamie Bennett
10
This bug affects 2 people
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 [======================================] 100.00 % 2.93 MB/s

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/ubuntu-core/812" to "/var/snap/ubuntu-core/812": failed to copy all: "cp: cannot stat '/var/snap/ubuntu-core/812': No such file or directory" (1))
jamie@goldstein:~$ sudo snap refresh --edge ubuntu-core
74.77 MB / 74.77 MB [======================================] 100.00 % 3.17 MB/s

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)
John Lenton (chipaca)
Changed in snappy:
status: New → Fix Committed
Michael Vogt (mvo)
Changed in snappy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.