Got a sha3-384 mismatch on first download

Heya,

Just got an error trying to install a snap from the store:

$ sudo snap install series-ninja
error: cannot perform the following tasks:
- Download snap "series-ninja" (9) from channel "stable" (sha3-384 mismatch for "series-ninja":
got
f1ec94b095e68e846e7340679f4334b3f632e083878cb172127dfae86dbcf22b41d9bbef6d45e6f8475f328044475504
but expected 
589f050cddf121abccea2573323f8f93326c5f484d1fa3bf22cd42fe66d8de1daaa53aec63542d2f16c0f481c61a7cfb)

Not sure of what’s happening here. That was the very first download attempt, so there wasn’t any delta work taking place.

Looking at the logs, I see that there was a retry:

Jun  7 13:21:58 nomade /usr/lib/snapd/snapd[4087]: retry.go:47: DEBUG: Retrying
https://public.apps.ubuntu.com/anon/download-snap/NaxeU1hH5ScFI6LN7sLklkf6t9YEFNJY_9.snap
, attempt 2, elapsed time=2m26.641635007s

It looks like in that second attempt the downloaded content was corrupted. I haven’t yet tested that unexpected hash, but I bet it’s from a mutation of the real content. Makes me wonder if the CDN is mishandling range requests. :confused:

Trying once more, the download was restarted from the ground up and succeeded.

Please note that this snap will most likely be removed from the store soon.

Thanks for this report. Do you have more log content ? I ask because the code should do an automatic retry on HashError once. I wonder if this code did not work for some reason or if it really tried it two times and got a hash error in both cases (and if that is the case its interessting that your manual subsequent attempt worked).