We have devices running snaps in some pretty remote locations with poor connectivity. Sometimes we observe that during refresh, snap downloads error out - with an “unexpected EOF” error.
Doing a refresh manually on a particular device in Sierra Leone, I observe that the ~50MB download chugs along fine for a while at ~25kB/sec, but then about a quarter of the way through the dreaded “unexpected EOF” comes up and everything drops dead.
error: cannot perform the following tasks: - Download snap "some-snap" (430) from channel "stable" (unexpected EOF)
Now, this is clearly due to some sort of network connection reset, but after 4-5 retries it seems to happen pretty consistently. This behavior may end up being particularly problematic due to the amount of (expensive mobile) data that would get eaten up over a number of auto-retries - though that’s a separate point.
For the moment I’m trying to brainstorm a work-around that allows me to push the update through despite the network disconnects. I’d love to get the community’s feedback on either of the following ideas:
- Somehow having
snapdresume a previously interrupted download, rather than starting over each time. I’m confident that something like this would manage to pull the full file through after a couple of attempts - as the connection is at least good enough for chunks of 10-20MB to be downloaded at a time.
- Copying the snap file onto the device manually (e.g. as a chunked zip file) and installing it from that. Perhaps I can use the method outlined in Offline snap installers and possibility to update in order to install the snap in an “approved” way (i.e. without
--dangerous) that would still make it look like the snap came from the store, and make future refreshes possible. Hopefully the assertion file is portable across devices.
Clearly #1 would be preferable (and more easily scalable to a larger number of devices), but I figured I’d put the general question out there for any thoughts.
Thanks in advance!