Snapd refresh doesn't recover from connection interruption
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Committed
|
High
|
Unassigned |
Bug Description
As discussed with Ondrej Kubik:
Multiple devices in our production fleet have been failing to upgrade. After issuing the refresh command snapd started to download kernel, core and other application downloads. Devices are connected via 4G connections of varying quality and intermittent interruptions. After 24 hours we established a remote connection to check the state of the machine and spotted the stuck download operations. The only way to recover from this state was to issue "snap abort", causing the system to revert all updates/downloads and rebooting. As rebooting hasn't been reliable this isn't desired behavior.
System:
- Dell Gateway 3002
- Ubuntu Core 16 with recent updates
Steps:
- `snap refresh`
- Interrupt connection during download
- Re-establish connection
- Snapd doesn't continue/restart download
Expected solution:
- Keep retrying downloads on interruptions
- Optional: Timeout to automatically abort tasks if resources can't be downloaded in X minutes/hours
- Optional: System applying partial refresh of packages.
Snap task:
Doing yesterday at 15:05 UTC - Download snap "caracalla-kernel" (144) from channel "latest/stable" (11.63%)
Doing yesterday at 15:05 UTC - Download snap "uefi-fw-tools" (22) from channel "latest/stable" (61.64%)
Snap task error:
2020-12-
no longer affects: | snappy |
Hello Onno,
Thank you for the report. This has been observed before and we hope to have a fix with https:/ /github. com/snapcore/ snapd/pull/ 9580 ; it was merged into development tree and should become available with snapd 2.49. Snapd does in fact implement various strategies for retrying (and bailing out) for network operations, but in this case it got stuck on the very low level (as you can see from the description of the PR I linked).