Channel switching (track new channel) does not work if the two channels happen to have identical snap packages

Bug #1650689 reported by Tony Espy on 2016-12-16
This bug affects 4 people
Affects Status Importance Assigned to Milestone

Bug Description

It's not possible today to redirect a snap's channel without there being an actual update available. If I run the following command on a UC16 system that I'd installed network-manager on from candidate or edge, if there's not a newer revision available in the stable channel, the following command will output an error, and not update the network-manager snap so that the next refresh would be done from stable. Perhaps a --force argument would suffice?

$ snap refresh --stable network-manager

We have a use case for this in commercial engineering where a system image was built using candidate, and we were able to partially update it to point stable for all the snaps with available updates. For the few snaps that didn't, we resorted to in-place rebuilds with a version bump.

I'm running the latest core snap, containing snap 2.18.1.

Tags: lxd Edit Tag help
Simos Xenitellis  (simosx) wrote :

It's a bug. Let's see more.

$ snap info network-manager
name: network-manager
summary: "Network management based on NeworkManager"
publisher: canonical
description: |
  Network management of wired ethernet, WiFi and mobile data connection based on
  NetworkManager and ModemManager
  stable: 1.2.2-10 (73) 5MB -
  candidate: 1.2.2-10 (73) 5MB -
  beta: 1.2.2-10 (73) 5MB -
  edge: 1.2.2-10 (112) 5MB -

Let's say you install the "beta":

$ snap install network-manager --channel=beta
network-manager (beta) 1.2.2 from 'canonical' installed

Let's try to switch from 'beta' to 'stable':

$ snap refresh network-manager --channel=stable
snap "network-manager" has no updates available

Because 'stable' and 'beta' are currently identical, the channel switching code refuses to make the switch, and start tracking the new channel.

A nasty workaround in this case would be to switch first to 'edge', then switch to 'stable'. Because these are different, the switching will work.

If two channels have identical snaps, then 'snap refresh' should be able to change the tracking and track the new channel.

summary: - snap refresh with a channel arg should offer a way to switch the channel
- w/out a snap update being available
+ Channel switching (track new channel) does not work if the two channels
+ happen to have identical snap packages

Yes, but I think we also want an explicit "switch" command which just
changes the channel. It could make a refresh, if available,
asynchronously, but it should first just make the channel switch and
then try to see if a change is proposed.

$ snap switch foo latest/beta
Tracking latest/beta
Revision 23 is current

$ snap switch foo latest/edge
Tracking latest/edge
Unable to contact store to search for updated revision

Stéphane Graber (stgraber) wrote :

I've also been hitting this issue a bunch of times on system which I temporarily move over to our candidate channel for LXD so I can have them run the next release for a little while, then promote the rev to stable and now my systems are stuck in candidate even though I'd prefer them being back in stable.

I'm fine with either having "snap refresh --stable" work in such sceneraio or Mark's suggested "snap switch"I'd be fine with a "snap switch" command, but I I'd be fine with a "snap switch" command since in my case there's nothing to upgrade/downgrade to anyway.

tags: added: lxd
Michael Vogt (mvo) wrote :
Changed in snappy:
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers