Snapd 2.59.2 in-place updates not working (firefox beta): PROBABLY FIXED

It was recently publicised that snapd >= 2.59.1 will handle updates for applications which are open. Applications which are open are still blocked from updating, but I understood that applications will automaticaly update the next time they are started. Described in 2.59 release notes as “Pre-download of snaps ready for refresh and automatic refresh of the snap when all apps are closed”.

I interpret “all apps are closed” as “all instances of the app with a pending update are closed”.

This is not working for me. Right now in Ubuntu 23.04 I have Firefox beta 113.0b9 open. snap refresh --list shows a new version is available.

However, it does not update. snap and snapd are v 2.59.2

Either I don’t understand how the new update feature works, or it doesn’t work.

3 Likes

I’m not running the beta release of Firefox but the new update procedure worked for me when updating to version 113.0. This is using Ubuntu 22.04 and snapd 2.59.2.

On getting a notification that a snap update was pending I closed Firefox. After about 10 seconds I received another notification telling me that the update had been applied and I could restart Firefox.

‘snap changes’ shows:

885 Done today at 14:12 BST today at 14:12 BST Pre-download tasks for auto-refresh

886 Done today at 14:14 BST today at 14:14 BST Auto-refresh snap “firefox”

So it works in principle but is running a version of Firefox not from the stable track a factor?

I also use Firefox beta and have been seeing the same as the OP, that is, not seeing the new behavior.

Hi timattrn,

The refresh is triggered either based on refresh schedule (inspect with snap refresh --time) or on manual refresh (snap refresh or snap refresh `).

Did you trigger the refresh manually after snap refresh --list showed update available?

For better information on why a refresh is perhaps not triggering try snap refresh <snap name>, which will e.g. indicate which snap pids are preventing the update.

Hi @ernestl,

I’m not the OP, but I have the same issue. Last night after a new Firefox beta build was completed, I ran snap info firefox to confirm it was available. I then ran snap refresh with the response that all snaps are up to date. Next I ran snap refresh firefox, and the response was ~10 Firefox PIDs prevented the refresh. (I didn’t save the exact output.) After closing Firefox, it did refresh OK with snap refresh firefox.

I have not tried snap refresh --list, which I will do after the next Firefox beta built update, and I’ll save the snap refresh firefox output.

(I know previously enabled the experimental snap refresh awareness feature, but that that was enabled for everyone so I doubt it should matter.)

Thanks for the updates. Based on the volume of complaints on reddit, it is not working for many people. To be honest, there is not one single report of anyone saying it is working.

Reddit is not the greatest metric in the world, but I am a good user and want to help. It absolutely not working for me. I am using firefox beta since it updates so frequently, it should be a good test. I don’t get the nags, but it is definitely failing to update, even after logout or reboot. I updated it manually finally, and it went from 113b9 to 114b2 (so in the time I gave it to work, it missed an entire release).

I am using the new snap store (the alpha/preview channel). Apart from that, it is a vanilla 23.04 install. The same problem is also the case for my 22.04.2 main desktop, and a 22.04 VM I use for development. So it is not working 100% of the time for my sample.

I can now add a fourth installation not working. I have a vanilla 23.04 with firefox snap (not beta).

firefox is open

tim@tim-Standard-PC-Q35-ICH9-2009:~$ snap refresh
All snaps up to date.
tim@tim-Standard-PC-Q35-ICH9-2009:~$ snap refresh --list
Name     Version    Rev   Size   Publisher  Notes
firefox  112.0.2-1  2611  255MB  mozilla\u2713   -

so there is a pending update. But nothing happens. When trying to update from the Software Store app, there are process in use errors (as seen in the systemctl output, third last line).

snapd.service - Snap Daemon
     Loaded: loaded (/lib/systemd/system/snapd.service; enabled; preset: enabled)
     Active: active (running) since Thu 2023-05-11 09:26:56 AEST; 4min 10s ago
TriggeredBy: \u25cf snapd.socket
   Main PID: 552 (snapd)
      Tasks: 11 (limit: 4556)
     Memory: 90.7M
        CPU: 1.143s
     CGroup: /system.slice/snapd.service
             \u2514\u2500552 /usr/lib/snapd/snapd

May 11 09:26:56 tim-Standard-PC-Q35-ICH9-2009 snapd[552]: daemon.go:340: adjusting startup timeout by 1m10s (pessimistic estimate of 30s plus 5s per snap)
May 11 09:26:56 tim-Standard-PC-Q35-ICH9-2009 snapd[552]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
May 11 09:26:56 tim-Standard-PC-Q35-ICH9-2009 systemd[1]: Started snapd.service - Snap Daemon.
May 11 09:27:19 tim-Standard-PC-Q35-ICH9-2009 snapd[552]: storehelpers.go:769: cannot refresh: snap has no updates available: "bare", "core22", "gnome-42-2204", "gtk-common-themes", >
May 11 09:27:19 tim-Standard-PC-Q35-ICH9-2009 snapd[552]: storehelpers.go:769: cannot refresh: snap has no updates available: "bare", "core22", "gnome-42-2204", "gtk-common-themes", >
May 11 09:27:21 tim-Standard-PC-Q35-ICH9-2009 snapd[552]: storehelpers.go:769: cannot refresh: snap has no updates available: "bare", "core22", "gnome-42-2204", "gtk-common-themes", >
May 11 09:28:40 tim-Standard-PC-Q35-ICH9-2009 snapd[552]: storehelpers.go:769: cannot refresh: snap has no updates available: "bare", "core22", "gnome-42-2204", "gtk-common-themes", >
May 11 09:28:40 tim-Standard-PC-Q35-ICH9-2009 snapd[552]: snapstate.go:1854: cannot refresh snap "firefox": snap "firefox" has running apps (firefox), pids: 2162,2367,2391,2572,2874,>
May 11 09:28:41 tim-Standard-PC-Q35-ICH9-2009 snapd[552]: storehelpers.go:769: cannot refresh: snap has no updates available: "bare", "core22", "firefox", "gnome-42-2204", "gtk-commo>
May 11 09:28:44 tim-Standard-PC-Q35-ICH9-2009 snapd[552]: storehelpers.go:769: cannot refresh: snap has no updates available: "bare", "core22", "gnome-42-2204", "gtk-common-themes", >
~

Hi, to me this sounds like you are describing the legacy functionality,: snap will refresh when the app is not open and when a refresh is triggered according to manual intervention or the every six hours timer (as long as the application is not open at that moment. For me it very unlikely that the computer is on and the browser is not open.

This is pre 2.59 behaviour and it sucks. It works for sure, if you play ball. But it is not what I am referring to.

I am talking about updating triggered when the application is closed. This is how it is described here:

“Snap users will be happy to know that we have implemented new functionality in snapd to streamline the refresh experience for all desktop snaps. With this change, snaps will now download and pre-initialise an update (when available) in the background then wait for the app to close- or the system to reboot- before switching to the new version. This means users can apply updates immediately by closing the application, and those updates will be applied more quickly than before, minimising disruption.”

This is not working for me at all.

Yes, for me also Firefox is not refreshing on close.

$ snap version
snap    2.59.2
snapd   2.59.2
series  16
ubuntu  22.04
kernel  5.15.0-70-generic 4 spaces
$ snap refresh --list
Name        Version           Rev   Size   Publisher   Notes
chromium    113.0.5672.63     2465  157MB  canonical✓  -
code        6a995c4f          128   316MB  vscode✓     classic
core18      20230426          2745  58MB   canonical✓  base
firefox     113.0-2           2645  253MB  mozilla✓    -
snap-store  41.3-71-g709398e  959   12MB   canonical✓  -

I think it worked for me one time, for some previous firefox update. When I saw the announcement of new snapd, I also saw that I had firefox update pending, then I manually ran snap refresh snapd (probably to version 2.59.1), and then firefox updated on close. But I’m not sure now if my memory is correct

Thanks everyone for highlighting the current confusion/frustration. Will do my best to work with everyone to clarify intended behaviour and potentially identify bugs if any.

Please allow me some time investigate.

4 Likes

Just to add, I’m seeing the same problem in the latest/candidate channel. The new update functionality was working fine for firefox on snapd 2.59.1 and stopped working around the time snapd was updated to 2.59.2. Not sure if that is coincidental though, as other snaps (e.g. slack) are updating as expected on 2.59.2 with the new functionality. The issue seems to be limited to firefox.

1 Like
$ snap refresh --list 
Name     Version    Rev   Size   Publisher  Notes
firefox  114.0b4-1  2677  255MB  mozilla✓   -

$ snap refresh firefox 
error: cannot refresh "firefox": snap "firefox" has running apps (firefox),
       pids:
       117679,117871,117936,117940,118039,118123,118297,118299,128021,128310,128
313,128503,128514,128611,128614,128736

Hi. I think this is happening because firefox is leaving processes hanging in its cgroup scope which means snapd can’t detect it has closed and refresh it (see: "Close the app to avoid disruptions" for a closed app). If this happens again, you can test that theory by running systemctl status and checking if there’s still a cgroup scope for the snap. As a short-term solution, killing the leftover processes under the cgroup will allow snapd to proceed with the refresh.

1 Like

Is there a way I can test this on demand, rather than just waiting for the next Firefox update? I know I can revert to a prior snap version, but does this then block automatic updates (it wouldn’t make sense for a user to manually revert a snap and then have snap just update it again, so I am not confident that this would work, I hope there is some other way)

Not on demand, but you could try Firefox nightly (edge channel) since it does update pretty much everyday.

I think it works if you close Firefox and then click the OK button from snap notification.

It did work for me today and atleast one time before.

It is working for me now, at least on the three desktops where the snap is beta channel. There has not yet been a stable update, so I don’t know in that case.

Based on feedback from miguel above, I noticed some strange messages in the journalctl -e about the firefox extension KDE Plasma Integration, something do with sockets. My firefox installs are synced so I get a common set of extensions, and sometimes I use KDE Plasma, although all the four installs I am talking about here are Ubuntu (gnome). I removed that extension and did a firefox refresh on all the desktops. ON each desktop the update to 114.0b7 worked. Immediately after exiting Firefox, snap changes shows the update starting and it takes around 10 seconds or so (I did not time this).

I reinstalled the KDE Plasma Integration extension to see if the problem can be reproduced. I tried to trigger this by reverting to a prior version, but it was inconclusive because I did not get the notification to update, that is, snap did not notice there as an update, or ignored it. So I will wait for a “natural” update to 114.0b8

1 Like

FWIW still not working for me:

$ snap refresh --list
Name     Version    Rev   Size   Publisher  Notes
firefox  114.0b8-1  2713  255MB  mozilla✓   -

$ snap refresh firefox 
error: cannot refresh "firefox": snap "firefox" has running apps (firefox),
       pids:
       342532,342776,342804,342823,342875,343670,343672,380409,380468,380516,380
549,380552,380858,380862,380916,380954,380996,381032,381072,381297,381309
,381370,381402,381454,381490,381531,381566,381638,381681,381761,381858,38
1975

@elcste I think even with the latest changes to the refresh process it is expected that you can NOT successfully run “snap refresh firefox” as long as firefox is running.

i think it just should do an automatic refresh when you close firefox. And before already download the necessary files - not sure if there is a UI/log for that.

Please correct me if i am wrong

Seems like not working for me (snapd 2.59.2, U22.04). I just saw update is pending, so it’s good opportunity to perform a test.

$ snap refresh --list
Name        Version           Rev   Size   Publisher   Notes
firefox     113.0.2-1         2710  254MB  mozilla✓    -

With running firefox, snap refresh produces expected result:

$ sudo snap refresh firefox
error: cannot refresh "firefox": snap "firefox" has running apps (firefox), pids:
       338004,338170,338193,338298,338423,339292,339295,347140,347243,350759,350839,351390,351486,351590

Closing firefox, no processes running as far as I can tell:

$ systemctl status | grep firefox
       │   │ │ │ └─351733 grep --color=auto firefox

Launching firefox again, version did not change:

$ snap info firefox
tracking:     latest/stable
refresh-date: 10 days ago, at 11:55 CEST
channels:
  latest/stable:    113.0.2-1     2023-05-23 (2710) 254MB -
  latest/candidate: 113.0.2-1     2023-05-22 (2710) 254MB -
  latest/beta:      114.0b8-1     2023-05-24 (2713) 255MB -
  latest/edge:      115.0a1       2023-05-25 (2721) 262MB -
  esr/stable:       102.11.0esr-2 2023-05-09 (2642) 186MB -
  esr/candidate:    102.11.0esr-2 2023-05-04 (2642) 186MB -
  esr/beta:         ↑                                     
  esr/edge:         ↑                                     
  installed:          113.0.1-1                (2667) 253MB -