snap refresh fails to recover after network disconnection
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
I'm trying to update firefox package on an unstable network which frequently disconnects and then reconnects.
Snap manager is expected to react to network conditions and adapt download speed accordingly.
What happens instead is that as soon as network bandwidth starts to shrink, the download starts to slow down to 0.00 bytes/sec and then hangs.
The download will never recover, even when network connection is established back, so in the end the process will exit with an error code.
Then if I run again the command: snap refresh firefox, the download will restart from zero instead of resuming the failed download!
1) Ubuntu Release: 22.04
2) apt-cache policy snap
snap:
Installato: (nessuno)
Candidato: 2013-11-29-11
Tabella versione:
2013-11-29-11 500
500 http://
3) What you expected to happen
When the network is back after a disconnection, the download speed should start to raise back to the maximum available bandwidth. Moreover, in case the download fails, when snap refresh is relaunched it should resume the failed download from where it stopped.
4) What happened instead
When snap starts to download the package, it creates the file:
/var/lib/
where 2067 is the current version and 2088 the newest one.
Then the network connection starts to get unstable and eventually disconnects for a few seconds. The refresh process starts to slow down the download speed accordingly.
When network connection is back, the snap process doesn't seem to realize it and the download speed keeps to fall all the way down to zero.
In the end, the refresh command fails with the following error:
$ snap refresh firefox
errore: cannot perform the following tasks:
- Scarica lo snap "firefox" (2088) dal canale "latest/stable" (download too slow: 0.00 bytes/sec)
Even more severe problem: the firefox_
That makes update virtually impossible on my network, since each time it will start from the beginning and eventually fail, as soon as the network disconnects.
Hi. Thank you for reporting this bug. I tried to reproduce this, with both of a fresh install and a refresh, and had some mixed results. It seems like snapd will usually resume the download from the point it stopped, if the network is cut. However, I was able to see it going back to the beginning once. It could be that the time limit or the retry limit is reached. This warrants further investigation.
The "download too slow: 0.00 bytes/sec" error message also seems to suggests that in a period of 5 minutes nothing was downloaded. Was the network out for 5 minutes or was it out for just a short period of time and snapd didn't resume for 5 minutes?
Regarding the second problem of partial files being deleted, that is intended because it prevents partial files from taking up disk space, if the download was cancelled, too slow, etc. Interrupted downloads should be resumed in the same operation so this shouldn't be a problem.
Can you paste the output of `snap version` and attach the snapd.log file created by running `journalctl -u snapd > snapd.log` here please?
Thank you,
Miguel