refresh-awareness not applying update

Bug #2060309 reported by Ken VanDine
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
Incomplete
Undecided
Maciej Borzecki

Bug Description

I've noticed snapd is no longer applying updates when closing an app after being notified there's an update available for a running app.

snap --version
snap 2.61.2
snapd 2.61.2
series 16
ubuntu 23.10
kernel 6.5.0-15-generic

I've reproduced this with both firefox and telegram-desktop recently, on automatic refresh when new revisions are available.

snap changes does show the Pre-Download as complete, but nothing is triggered when the app exits. I waited a full hour and the update wasn't applied and was able to re-launch the app and a couple of hours later see a notification that there was again an update available.

I have reproduced this on 3 computers, 2 23.10 systems and a noble system. One of them had snapd beta installed

snap version
snap 2.62
snapd 2.62
series 16
ubuntu 23.10
kernel 6.5.0-26-generic

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

2.61.2 contained a known issue which prevented refresh from triggering after snap applications were closed if more than one snap was a candidate during an auto-refresh. I pushed a fix for that which ended up in 2.62.

However, given the feature has a lot of moving parts, there may still be some edge cases we haven't accounted for. Any chance you have logs (preferably SNAPD_DEBUG=1 logs) from the system which had 2.62 beta installed? Is experimental refresh app awareness enabled in that system?

Changed in snapd:
status: New → Incomplete
assignee: nobody → Ken VanDine (ken-vandine)
assignee: Ken VanDine (ken-vandine) → Maciej Borzecki (maciek-borzecki)
Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

Maybe that's why I wasn't able to reproduce this using "master" branch... Anyway, there seems to be two different bugs: one is this one, and the other is that it seems to not notice that there aren't updates for Firefox. I tried by reverting firefox and deleting the last revision, waited for the refresh, and the log said that there weren't updates for several snaps... and firefox was in the list.

I'll do some tests with the new code to ensure that it works, and if you consider that it can be useful, I can try to add some extra tests in the unitary tests. Which was the PR with the fix?

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

This one is the fix for the general re-refresh case: https://github.com/snapcore/snapd/pull/13591

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

About the firefox case: I did some tests and the problem seems to be in the store. If I do the same request than snapd, I receive that the most recent version available of firefox is 4033; but if I remove "Snap-Refresh-Reason":"scheduled" from the HTTP request header, then the store sends the right revision (4090).

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

I attach the test code (in python) that I used to test the firefox problem. At the end of the code you can comment or uncomment the 'snap-refresh-reason' entry and compare the result.

Ernest Lotter (ernestl)
Changed in snapd:
milestone: none → 2.62
Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

Throttling on the store side is a know issue. Snapd has some code added in https://github.com/snapcore/snapd/pull/13259 to work around this, but I don't know if it's going to be effective in all scenarios.

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

Mmm, so the problem is the store doing throttle, and thus hiding possible refreshes... The problem is that I receive a notification that there is a firefox update that can't be done because it is running, and when I close it, it isn't refreshed... I presume that in that second refresh, "Snap-Refresh-Reason":"scheduled" is also being sent, and the store throttles it... could that be? If that's the case, is that fixed with those patches?

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

Mmm... you are right: once the firefox announce is shown, it does refresh. So that bug seems to be fixed too. Thanks!

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.