SSP allows setting a override in air-gap mode, and ignores it

Bug #1953512 reported by Kyle Nitzsche
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
New
Undecided
Unassigned

Bug Description

SSP allows setting override for air-gap brand store snap, but ignores it.

Expectation
-----------

Command to set the override in air gap SSP should not have apparently succeeded:

Actual Experience
-----------------

Command to set override in air gap proxy did apparently succeed:

root@snap-store-proxy-3-air-gap:~# snap-proxy override test-revision stable=12
test-revision stable armhf 12 (upstream 12)
root@snap-store-proxy-3-air-gap:~#

Here's the detail
=================

test-revision snap (armhf) rev 12 is in ce-team-test store on latest/stable
--------------------------------------------------------------------

$ snapcraft status test-revision
Track Arch Channel Version Revision
latest amd64 stable - -
                 candidate - -
                 beta - -
                 edge 0.1 3
         armhf stable 0.3 12
                 candidate ↑ ↑
                 beta ↑ ↑
                 edge 0.1 1

Snap Store Proxy (SSP) is in air gap mode
-----------------------------------------

root@snap-store-proxy-3-air-gap:~# snap-proxy status
Store is in device authenticated air-gapped mode
Store ID: VJOYSBLFu9vv5RclvAEhDWOUcK5XaYJx
Custom local stores:
  Brand ID Name ID
  P6dgVeuoAbrvPznd7Ysvw9Bye4MrxgM3 CE Team Test ce-team-test
Local account keys:
  Account ID Name Public Key SHA3-384
(redacted)
  generic models d-JcZF9nD9eBw7bwMnH61x-bklnQOhQud1Is6o_cn2wTj8EYDi9musrIT9z2MdAa
  generic serials wrfougkz3Huq2T_KklfnufCC0HzG7bJ9wP99GV0FF-D3QH3eJtuSRlQc2JhrAoh1
Internal Service Status:
  memcached: running
  nginx: running
  snapassert: running
  snapauth: running
  snapdevicegw: running
  snapdevicegw-local: running
  snapident: running
  snapproxy: running
  snaprevs: running

In online SSP, I get test-revision snap
---------------------------------------

root@snap-store-proxy-2:~# snap-store-proxy fetch-snaps test-revision --store ce-team-test --auth /var/snap/snap-store-proxy/common/creds_store_admin --channel=stable --architecture=armhf
Fetching channel map info for test-revision
Fetching revision 12 for test-revision
Downloaded test-revision to /var/snap/snap-store-proxy/common/downloads/test-revision-20211207T140436.tar.gz

In air gap SSP, I push the test-revision rev 12 snap with channel map
---------------------------------------------------------------------

root@snap-store-proxy-3-air-gap:~# snap-store-proxy push-snap /var/snap/snap-store-proxy/common/test-revision-20211207T140436.tar.gz --push-channel-map
Snap pushed

In air gap SSP, I set override for test-revision to rev 12
-----------------------------------------------------------

root@snap-store-proxy-3-air-gap:~# snap-proxy override test-revision stable=12
test-revision stable armhf 12 (upstream 12)
root@snap-store-proxy-3-air-gap:~#

This appears to work, but, air gap SSP list-overrides seems to contradict
-------------------------------------------------------------------------

root@snap-store-proxy-3-air-gap:~# snap-proxy list-overrides test-revision
Proxy is in air-gapped mode, upstream revisions are not available
root@snap-store-proxy-3-air-gap:~#

Device using air gap SSP sees rev 12 (as expected)
--------------------------------------------------

knitzsche@ubuntu:~$ snap info test-revision
name: test-revision
summary: summary
publisher: knitzsche (Kyle Nitzsche)
store-url: https://snapcraft.io/test-revision
license: unset
description: |

snap-id: Hd1B6bexX487FYwOzk8ChZyja7A10QxS
channels:
  latest/stable: 0.3 2021-12-07 (12) 8kB -
  latest/candidate: ↑
  latest/beta: ↑
  latest/edge: ↑
knitzsche@ubuntu:~$

Release test-revision (armhf) rev 13 to stable
--------------------------------------

$ snapcraft upload test-revision_0.3_armhf.snap --release stable
Preparing to upload 'test-revision_0.3_armhf.snap'.
After uploading, the resulting snap revision will be released to 'stable' when it passes the Snap Store review.
Running the review tools before pushing this snap to the Snap Store.
Generating delta for 'test-revision_0.3_armhf.snap'.
Pushing 'test-revision_0.3_armhf.snap.xdelta3-0' [=========================================================] 100%
Processing...|
released
Revision 13 of 'test-revision' created.
Track Arch Channel Version Revision
latest armhf stable 0.3 13
                 candidate ↑ ↑
                 beta ↑ ↑
                 edge 0.1 1

In online SSP get test-revision, in air gap push it withouto channel map
-------------------------------------------------------------------

root@snap-store-proxy-2:~# snap-store-proxy fetch-snaps test-revision --store ce-team-test --auth /var/snap/snap-store-proxy/common/creds_store_admin --channel=stable --architecture=armhf
Fetching channel map info for test-revision
Fetching revision 13 for test-revision
Downloaded test-revision to /var/snap/snap-store-proxy/common/downloads/test-revision-20211207T143113.tar.gz

other system:

$ lxc file pull snap-store-proxy-2/var/snap/snap-store-proxy/common/downloads/test-revision-20211207T143113.tar.gz .
$ lxc file push test-revision-20211207T143113.tar.gz snap-store-proxy-3-air-gap/var/snap/snap-store-proxy/common/

air gap SSP:

root@snap-store-proxy-3-air-gap:~# snap-store-proxy push-snap /var/snap/snap-store-proxy/common/test-revision-20211207T143113.tar.gz
Uploaded snap and assertions for test-revision revision 13
Channel map already exists.
Not updating the channel map, you can try again with `--push-channel-map`
Snap pushed

On device, no channel map, new rev 13 not avail
-----------------------------------------------

knitzsche@ubuntu:~$ snap info test-revision
name: test-revision
summary: summary
publisher: knitzsche (Kyle Nitzsche)
store-url: https://snapcraft.io/test-revision
license: unset
description: |

snap-id: Hd1B6bexX487FYwOzk8ChZyja7A10QxS
channels:
  latest/stable: 0.3 2021-12-07 (12) 8kB -
  latest/candidate: ↑
  latest/beta: ↑
  latest/edge: ↑
knitzsche@ubuntu:~$

On air gap SSP, push with channel map
-------------------------------------

root@snap-store-proxy-3-air-gap:~# snap-store-proxy push-snap /var/snap/snap-store-proxy/common/test-revision-20211207T143113.tar.gz --push-channel-map
Snap pushed

On device, with channel map, rev 13 IS NOW AVAILABLE
----------------------------------------------------

knitzsche@ubuntu:~$ snap info test-revision
name: test-revision
summary: summary
publisher: knitzsche (Kyle Nitzsche)
store-url: https://snapcraft.io/test-revision
license: unset
description: |

snap-id: Hd1B6bexX487FYwOzk8ChZyja7A10QxS
channels:
  latest/stable: 0.3 2021-12-07 (13) 8kB -
  latest/candidate: ↑
  latest/beta: ↑
  latest/edge: ↑
knitzsche@ubuntu:~$

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.