Cannot refresh from ubuntu-core 2.15.2 on raspberry pi "ubuntu core 16" image - snap-declaration for "snapweb": parsing assertion headers: expected 4 chars nesting prefix after multiline introduction "plugs:": " network:"

Bug #1802773 reported by Zygmunt Krynicki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
Fix Released
High
Maximiliano Bertacchini
snapd
Invalid
High
Unassigned

Bug Description

I was reinstalling my fleet of devices when I noticed stable images cannot update due to a store response for snapweb.

zyga@localhost:~$ snap --version
snap 2.15.2
snapd 2.15.2
series 16

zyga@localhost:~$ sudo snap refresh
error: cannot refresh []: cannot refresh snap-declaration for "snapweb": parsing assertion headers: expected 4 chars nesting prefix after multiline introduction "plugs:": " network:"

zyga@localhost:~$ sudo snap refresh ubuntu-core
error: cannot refresh "ubuntu-core": cannot refresh snap-declaration for "snapweb": parsing assertion headers: expected 4 chars nesting prefix after multiline introduction "plugs:": " network:"

zyga@localhost:~$ sudo snap remove snapweb
snapweb removed

zyga@localhost:~$ sudo snap refresh ubuntu-core
[/] Make snap "ubuntu-core" (1799) available to the system
Broadcast message from <email address hidden> (Sun 2018-11-11 18:50:50 UTC):

reboot scheduled to update the system - temporarily cancel with 'sudo shutdown -c'
The system is going down for reboot at Sun 2018-11-11 19:00:50 UTC!

63.40 MB / 63.57 MB [===================================>_] 99.73 % 946.61 KB/s

ubuntu-core (beta) 16-2 from 'canonical' upgraded

Revision history for this message
Samuele Pedroni (pedronis) wrote :

this is likely related to a configuration change in the store that stopped interpreting missing max-format query param as max-format=0 on assertions.ubuntu.com/v1/assertions/<type>/<primary-key> requests

Changed in snapstore:
importance: Undecided → High
Revision history for this message
Samuele Pedroni (pedronis) wrote :

To be clear we do want to keep the new behavior on the snapdevicegw own endpoints, the assertions.ubutnu.com behavior is stricly for backward compatibility but it's fairly confusing curl using

Bret Barker (noise)
Changed in snapstore:
assignee: nobody → William Grant (wgrant)
Revision history for this message
Bret Barker (noise) wrote :

pedronis, can you complete your comment above? appears to have been cutoff.

William Grant (wgrant)
tags: added: regression snapstore-deployment
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'm marking the store side of the bug as confirmed since this prevents anyone from using the images from http://cdimage.ubuntu.com/ubuntu-snappy/16.04/current/

zyga@core16:~$ sudo snap refresh
error: cannot refresh []: cannot refresh snap-declaration for "snapweb": parsing assertion headers: expected 4 chars nesting prefix after multiline introduction "plugs:": " network:"

Changed in snapstore:
status: New → Confirmed
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

Not reproducible with the current ubuntu core 16 image from http://cdimage.ubuntu.com/ubuntu-core/16/stable/current/ (dated on 2019-08-06).

maxiberta@localhost:~$ snap version
snap 2.39.3
snapd 2.39.3
series 16
kernel 4.4.0-157-generic

maxiberta@localhost:~$ snap list
Name Version Rev Tracking Publisher Notes
core 16-2.39.3 7270 stable canonical✓ core
pc 16.04-0.10 33 stable canonical✓ gadget
pc-kernel 4.4.0-157.185 258 stable canonical✓ kernel

maxiberta@localhost:~$ sudo snap refresh
Setup snap "core" (8268) security profiles
Broadcast message from <email address hidden> (Fri 2020-02-07 19:30:12 UTC):
reboot scheduled to update the system
The system is going down for reboot at Fri 2020-02-07 19:40:12 UTC!
snapd is about to reboot the system

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

Some archaeology:
- Snapd 2.27 switched from "assertions.ubuntu.com" to "api.snapcraft.io", released on Aug 10 2017 [1][2].
- The assertions service switched json by default around Jan 15 2018 (it was committed on that date, not exactly sure when deployed to production but should be close enough)[3].

[1] https://github.com/snapcore/snapd/releases?after=2.28
[2] https://github.com/snapcore/snapd/pull/3500
[3] https://code.launchpad.net/~pedronis/snap-assertions-service/simplified-snap-assert/+merge/335253

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

- Snapd 2.17 started sending "max-format" when retrieving assertions, released on Nov 2, 2016 [4].

[4] https://github.com/snapcore/snapd/blob/master/packaging/ubuntu-16.04/changelog#L6669

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

So, iiuc, defaulting to the old format on requests with no explicit "max-format" on "assertions.ubuntu.com" would fix the issue.

Revision history for this message
Samuele Pedroni (pedronis) wrote :

> So, iiuc, defaulting to the old format on requests with no explicit "max-format" on "assertions.ubuntu.com" would fix the issue.

yes, I think the fix would be to detect) if a request comes through the "old" assertions.ubuntu.com and in that case use max-format=0 if max-format is not set

Changed in snapstore:
status: Confirmed → In Progress
assignee: William Grant (wgrant) → Maximiliano Bertacchini (maxiberta)
Changed in snapstore:
status: In Progress → Fix Committed
Changed in snapstore:
status: Fix Committed → In Progress
Changed in snapstore:
status: In Progress → Fix Released
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

> yes, I think the fix would be to detect) if a request comes through the "old" assertions.ubuntu.com and in that case use max-format=0 if max-format is not set

This fix has been implemented server-side in the Snap Store. No action needed from snapd, afaict.

Changed in snapd:
status: Confirmed → Invalid
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.