trying to upload a delta if delta service is disabled fails

Bug #1780851 reported by Daniel Manrique
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snap Store Server
Won't Fix
Low
Maximiliano Bertacchini
Snapcraft
Fix Released
High
Kyle Fazzari

Bug Description

If upload deltas are disabled on the snap store servers, snapcraft fails like this when trying to upload a delta (easy way to ensure it's a delta upload: push two revisions of the same snap, one after the other).

After pushing, an attempt will be made to release to 'edge'
Preparing to push '/home/ubuntu/minisnap/hello-roadmr-1_2018-07-09-02_amd64.snap' to the store.
Found cached source snap /home/ubuntu/.cache/snapcraft/projects/hello-roadmr-1/snap_hashes/amd64/81d67619708155032388f69f382e0975d7c9dbdce6ec25590c1e6faf844b155ca307966c9c1af8e6b29ebfe44dcc0c68.
Generating xdelta3 delta for hello-roadmr-1_2018-07-09-02_amd64.snap.
Pushing delta /home/ubuntu/minisnap/hello-roadmr-1_2018-07-09-02_amd64.snap.xdelta3.
Pushing hello-roadmr-1_2018-07-09-02_amd64.snap.xdelta3 [==========================================] 100%
The Snap Store encountered an error while processing your request: not implemented (code 501).
The operational status of the Snap Store can be checked at https://status.snapcraft.io/

> snapcraft --version
snapcraft, version 2.42.1+18.4
> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

this regressed in 2.42.1, because with 2.42 things work well, snapcraft gets the same 501 code from the store (which means deltas are not available/not implemented) and falls back to a full-snap upload (with a nice error saying delta support is disabled):

Pushing hello-roadmr-1_2018-07-09-02_amd64.snap
After pushing, an attempt will be made to release to 'edge'
Preparing to push '/home/ubuntu/minisnap/hello-roadmr-1_2018-07-09-02_amd64.snap' to the store.
Found cached source snap /home/ubuntu/.cache/snapcraft/projects/hello-roadmr-1/snap_hashes/amd64/81d67619708155032388f69f382e0975d7c9dbdce6ec25590c1e6faf844b155ca307966c9c1af8e6b29ebfe44dcc0c68.
Generating xdelta3 delta for hello-roadmr-1_2018-07-09-02_amd64.snap.
Pushing delta /home/ubuntu/minisnap/hello-roadmr-1_2018-07-09-02_amd64.snap.xdelta3.
Pushing hello-roadmr-1_2018-07-09-02_amd64.snap.xdelta3 [==========================================] 100%
Unable to push delta to store: The delta upload support is currently disabled.
Falling back to pushing full snap...
Pushing hello-roadmr-1_2018-07-09-02_amd64.snap [==================================================] 100%
Processing...|
Ready to release!
Revision 51 of 'hello-roadmr-1' created.
Track Arch Channel Version Revision Expires at
latest amd64 stable 2018-06-08-01 47
                 candidate ^ ^
                 beta ^ ^
                 edge 2018-07-09-02 51
                 stable/mybranch 2018-06-08-01 47 2018-07-15T21:44:58.667374

We think the commit that regressed here was:

https://github.com/snapcore/snapcraft/commit/c6500ca0ed3cf4fe564a15adfb0a46ff0a3a787f

storeapi: handle 5xx error codes for all store endpoints (#2116)
Currently, the snapcraft CLI handles a 500 response when releasing a
snap. Make this more robust, and nicely handle 5xx codes for all
endpoints.

As reference, the response when deltas are disabled is that 501 HTTP status code with this payload:
{"error_list": [{"message": "The delta upload support is currently disabled.", "code": "feature-disabled"}]}

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Thanks Daniel, looks like we're missing a test case for that scenario.

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Just learned at Montreal that this is an issue making store development quite difficult, since in development deltas are disabled. Upping priority as a result. Proposed fix is here: https://github.com/snapcore/snapcraft/pull/2181 .

Changed in snapcraft:
importance: Medium → High
assignee: nobody → Kyle Fazzari (kyrofa)
Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: Triaged → In Progress
Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
milestone: none → 2.43
Changed in snapcraft:
status: Fix Committed → Fix Released
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

On the Snap Store side, if upload deltas are disabled it should not return a 5xx status.

Bret Barker (noise)
Changed in snapstore:
assignee: nobody → Maximiliano Bertacchini (maxiberta)
importance: Undecided → Low
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

The Snap Store API currently returns 501 if snap upload support is disabled, and snapcraft correctly falls back to pushing the full snap. Being a server-side condition the 501 status makes sense, in contrast to a 4xx status that would confusingly indicate a client side error.

$ snapcraft push htop-snap_2.2.0-18-gb7b4200_amd64.snap
...
Unable to push delta to store: The delta upload support is currently disabled.
Falling back to pushing full snap...
...

$ snapcraft version
snapcraft, version 3.0.1

Changed in snapstore:
status: New → Won't Fix
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.