snap 2.59.2 is not doing Firefox updates automatically

Bug #2019158 reported by Tim Richardson
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
snapd
Fix Committed
High
Miguel Pires

Bug Description

Changelog for snap 2.59 says that pending updates will be applied once "all apps are closed".
I assume this means "all processes associated with an app that has a pending update".

Well, it is not working for in four Ubuntu installs, two 22.04 and two 23.04 including a vanilla 23.04 VM.

See discussion here: https://forum.snapcraft.io/t/not-a-snap-cgroup-error-when-running-chromium/33243/3

I do not know where to report this bug.

I can reproduce this with firefox beta or firefox snap.

snap refresh --list shows there is an update
But it is never automatically applied when the app is closed.

Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

Hi, I see snaps are being auto-refreshed using snapd 2.59.3, could you please share the snapd journal logs and snap changes?
# journalctl -u snapd
# snap changes

Thanks

Revision history for this message
Tim Richardson (tim-richardson) wrote : Re: [Bug 2019158] Re: snap 2.59.2 is not doing updates automatically

I don't have 2.59.3, only 2.59.2
How do I get 2.59.3 ?

On Tue, 16 May 2023 at 00:29, Sergio Cazzolato <email address hidden>
wrote:

> Hi, I see snaps are being auto-refreshed using snapd 2.59.3, could you
> please share the snapd journal logs and snap changes?
> # journalctl -u snapd
> # snap changes
>
> Thanks
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2019158
>
> Title:
> snap 2.59.2 is not doing updates automatically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>
>

--
Tim Richardson

Revision history for this message
Tim Richardson (tim-richardson) wrote :
Download full text (4.8 KiB)

I found 2.59.4 in latest/beta.
It doesn't work any differently though.
Firefox does not refresh when I exit

this is some terminal output. I had Firefox running.

tim@tim-Standard-PC-Q35-ICH9-2009:~$ snap --version
snap 2.59.4
snapd 2.59.4
series 16
ubuntu 23.04
kernel 6.2.0-20-generic
tim@tim-Standard-PC-Q35-ICH9-2009:~$ snap refresh --list
Name Version Rev Size Publisher Notes
firefox 113.0.1-1 2681 255MB mozilla\u2713 -
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 113.0.1-1 2681 255MB mozilla\u2713 -
tim@tim-Standard-PC-Q35-ICH9-2009:~$ snap refresh --list
Name Version Rev Size Publisher Notes
firefox 113.0.1-1 2681 255MB mozilla\u2713 -
tim@tim-Standard-PC-Q35-ICH9-2009:~$

I close it. It's been closed for a few minutes now.
ps -e | grep firefox is empty.

tim@tim-Standard-PC-Q35-ICH9-2009:~$ snap refresh --list
Name Version Rev Size Publisher Notes
firefox 113.0.1-1 2681 255MB mozilla\u2713 -
tim@tim-Standard-PC-Q35-ICH9-2009:~$

May 16 17:00:50 tim-Standard-PC-Q35-ICH9-2009 systemd[1]: Starting
snapd.service - Snap Daemon...
May 16 17:00:51 tim-Standard-PC-Q35-ICH9-2009 snapd[528]: overlord.go:272:
Acquiring state lock file
May 16 17:00:51 tim-Standard-PC-Q35-ICH9-2009 snapd[528]: overlord.go:277:
Acquired state lock file
May 16 17:00:51 tim-Standard-PC-Q35-ICH9-2009 snapd[528]: daemon.go:247:
started snapd/2.59.4 (series 16; classic) ubuntu/23.04 (amd64)
linux/6.2.0-2>
May 16 17:00:51 tim-Standard-PC-Q35-ICH9-2009 snapd[528]: daemon.go:340:
adjusting startup timeout by 1m10s (pessimistic estimate of 30s plus 5s per
>
May 16 17:00:51 tim-Standard-PC-Q35-ICH9-2009 snapd[528]: backends.go:58:
AppArmor status: apparmor is enabled and all features are available
May 16 17:00:52 tim-Standard-PC-Q35-ICH9-2009 systemd[1]: Started
snapd.service - Snap Daemon.
May 16 17:01:08 tim-Standard-PC-Q35-ICH9-2009 snapd[528]:
storehelpers.go:769: cannot refresh: snap has no updates available: "bare",
"core22", "gnom>
May 16 17:01:09 tim-Standard-PC-Q35-ICH9-2009 snapd[528]:
storehelpers.go:769: cannot refresh: snap has no updates available: "bare",
"core22", "gnom>
May 16 17:01:10 tim-Standard-PC-Q35-ICH9-2009 snapd[528]:
storehelpers.go:769: cannot refresh: snap has no updates available: "bare",
"core22", "gnom>
May 16 17:01:27 tim-Standard-PC-Q35-ICH9-2009 snapd[528]:
storehelpers.go:769: cannot refresh: snap has no updates available: "bare",
"core22", "gnom>
May 16 17:01:37 tim-Standard-PC-Q35-ICH9-2009 snapd[528]:
storehelpers.go:769: cannot refresh: snap has no updates available: "bare",
"core22", "gnom>
May 16 17:01:37 tim-Standard-PC-Q35-ICH9-2009 snapd[528]:
snapstate.go:1854: cannot refresh snap "firefox": snap "firefox" has
running apps (firefox)>
May 16 17:01:43 tim-Standard-PC-Q35-ICH9-2009 snapd[528]:
storehelpers.go:769: cannot refresh: snap has no updates available: "bare",
"core22", "gnom>
May 16 17:02:24 tim-Standard-PC-Q35-ICH9-2009 snapd[528]:
storehelpers.go:769: cannot refresh: snap has no updates available: "bare",
"core22"...

Read more...

Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote : Re: snap 2.59.2 is not doing updates automatically

I see it is listed "firefox 113.0.1-1 2681" and there is not a stable release with that revision.
Could you please add the output of

# snap info firefox

Revision history for this message
Tim Richardson (tim-richardson) wrote : Re: [Bug 2019158] Re: snap 2.59.2 is not doing updates automatically

However, snap updated successfully when I closed firefox and sudo snap
refresh. So there is no problem with snap doing the update the legacy way.
It just is not updating when the app closes. It's not just me, it's mostly
everyone (see discussion on snapcraft:
https://forum.snapcraft.io/t/snapd-2-59-2-in-place-updates-not-working-firefox-beta/35081/8
)

For me, this is trivial to reproduce. I have this problem in all four
ubuntu desktop installs, I use, two on 22.04 and two on 23.04.

The one I am using for this ticket is a vanilla VM install.

I am glad you are looking into it, and I hope we can work out what is wrong.

 here is me manually updating it.
This always works. On my of those Ubuntu installs, I am using the beta
channel because it updates so often, it seems like a good test of this
problem.
It never updates when the application closes, not once. And it always
updates the legacy method (that is, by cli invocation after I close the
browser processes).

tim@tim-Standard-PC-Q35-ICH9-2009:~$ snap refresh --list
Name Version Rev Size Publisher Notes
firefox 113.0.1-1 2681 255MB mozilla\u2713 -
tim@tim-Standard-PC-Q35-ICH9-2009:~$
tim@tim-Standard-PC-Q35-ICH9-2009:~$
tim@tim-Standard-PC-Q35-ICH9-2009:~$ ps -e | grep firefox
tim@tim-Standard-PC-Q35-ICH9-2009:~$ sudo snap refresh
[sudo] password for tim:
firefox (stable/ubuntu-23.04) 113.0.1-1 from Mozilla\u2713 refreshed
tim@tim-Standard-PC-Q35-ICH9-2009:~$ snap info firefix
error: no snap found for "firefix"
tim@tim-Standard-PC-Q35-ICH9-2009:~$ snap info firefox
name: firefox
summary: Mozilla Firefox web browser
publisher: Mozilla\u2713
store-url: https://snapcraft.io/firefox
contact:
https://support.mozilla.org/kb/file-bug-report-or-feature-request-mozilla
license: unset
description: |
  Firefox is a powerful, extensible web browser with support for modern web
  application technologies.
commands:
  - firefox
  - firefox.geckodriver
snap-id: 3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk
tracking: latest/stable/ubuntu-23.04
refresh-date: today at 08:09 AEST
channels:
  latest/stable: 113.0.1-1 2023-05-12 (2667) 253MB -
  latest/candidate: 113.0.1-1 2023-05-12 (2667) 253MB -
  latest/beta: 114.0b4-1 2023-05-15 (2677) 255MB -
  latest/edge: 115.0a1 2023-05-16 (2684) 261MB -
  esr/stable: 102.11.0esr-2 2023-05-09 (2642) 186MB -
  esr/candidate: 102.11.0esr-2 2023-05-04 (2642) 186MB -
  esr/beta: \u2191
  esr/edge: \u2191
installed: 113.0.1-1 (2681) 255MB -

On Wed, 17 May 2023 at 04:15, Sergio Cazzolato <email address hidden>
wrote:

> I see it is listed "firefox 113.0.1-1 2681" and there is not a stable
> release with that revision.
> Could you please add the output of
>
> # snap info firefox
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2019158
>
> Title:
> snap 2.59.2 is not doing updates automatically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>
>

--
Tim Richardson

Revision history for this message
Tim Richardson (tim-richardson) wrote : Re: snap 2.59.2 is not doing updates automatically
Download full text (4.4 KiB)

On a 22.04 VM, I got a pop up about a firefox update, please close.... snap changes says "pre-download tasks for auto-refresh" with a timestamp matching the pop up.
But no update happens.

...

... I just got the notification that pending updates are available for firefox in my dev VM (the VM thinks it has a cable connection).

this is output from systemctl status snapd

The notification happened at 09:59 so the 09:54 error, whatever it is, did not stop the notification pop up:

\u25cf snapd.service - Snap Daemon Loaded: loaded (/lib/systemd/system/snapd.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2023-05-18 09:53:46 AEST; 6min ago TriggeredBy: \u25cf snapd.socket Main PID: 907 (snapd) Tasks: 26 (limit: 19111) Memory: 514.2M CPU: 4.223s CGroup: /system.slice/snapd.service \u2514\u2500907 /usr/lib/snapd/snapd

May 18 09:53:45 ubuntu-virtio systemd[1]: Starting Snap Daemon...
May 18 09:53:46 ubuntu-virtio snapd[907]: overlord.go:272: Acquiring state lock file
May 18 09:53:46 ubuntu-virtio snapd[907]: overlord.go:277: Acquired state lock file
May 18 09:53:46 ubuntu-virtio snapd[907]: daemon.go:247: started snapd/2.59.4 (series 16; classic) ubuntu/22.04 (amd64) linux/5.19.0-41-generic.
May 18 09:53:46 ubuntu-virtio snapd[907]: daemon.go:340: adjusting startup timeout by 2m35s (pessimistic estimate of 30s plus 5s per snap)
May 18 09:53:46 ubuntu-virtio snapd[907]: backends.go:58: AppArmor status: apparmor is enabled and all features are available
May 18 09:53:46 ubuntu-virtio systemd[1]: Started Snap Daemon.
May 18 09:54:19 ubuntu-virtio snapd[907]: stateengine.go:149: state ensure error: persistent network error: Get https://api.snapcraft.io/api/v1/snaps/sections: dial tcp: lookup api.snapcraft.io: Temporary failure in name resolution
May 18 09:59:21 ubuntu-virtio snapd[907]: storehelpers.go:769: cannot refresh: snap has no updates available: "authy", "bare", "btop", "certbot", "cheat", "core", "core18", "core20", "core22", "cups", "gedit", "gnome-3-28-1804", "gnome-3-38-2004", "gnome-42-2204", "gtk-common-themes", "helm", "hunspell-dictionaries-1-7-2004", "kubectl", "kubectx", "libreoffice", "snap-store", "snapd", "snapd-desktop-integration", "yq"

I still have firefox open.

[sudo] password for tim:
snap-store (preview/edge) 0.2.9-alpha from Canonical\u2713 refreshed
[~] [cultiver@eks] $ sudo snap refresh --list
Name Version Rev Size Publisher Notes
firefox 114.0b5-6 2690 255MB mozilla\u2713 -
[~] [cultiver@eks] $

I am using latest snap 2.59.4

[~] [cultiver@eks] $ snap --version
snap 2.59.4
snapd 2.59.4
series 16
ubuntu 22.04
kernel 5.19.0-41-generic
[~] [cultiver@eks] $

It has reported "pre-download tasks":

[~] [cultiver@eks] $ snap changes
ID Status Spawn Ready Summary
393 Done yesterday at 11:08 AEST yesterday at 11:08 AEST Switch "snapd" snap to channel "latest/beta"
394 Done yesterday at 11:08 AEST yesterday at 11:09 AEST Refresh snaps "core20", "snapd"
395 Done today at 09:59 AEST today at 09:59 AEST Pre-download tasks for auto-refresh
396 Done today at 10:03 AEST today at 10:03 AEST Refres...

Read more...

Revision history for this message
Tim Richardson (tim-richardson) wrote :
Download full text (13.1 KiB)

[cultiver@eks] $ journalctl -e
May 18 10:06:12 ubuntu-virtio firefox_firefox.desktop[6906]: [Child 6906, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox/parts/firefox/build/dom/ipc/jsactor/JSWindowActorChild.cpp:57
May 18 10:06:12 ubuntu-virtio firefox_firefox.desktop[6906]: [Child 6906, Main Thread] WARNING: JSWindowActorChild::SendRawMessage (Conduits, ConduitClosed) not sent: !CanSend() || !mManager || !mManager->CanSend(): file /build/firefox/parts/firefox/build/dom/ipc/jsactor/JSWindowActorChild.cpp:57
May 18 10:06:12 ubuntu-virtio firefox_firefox.desktop[6585]: [ERROR viaduct::backend::ffi] Missing HTTP status
May 18 10:06:12 ubuntu-virtio firefox_firefox.desktop[6585]: [ERROR viaduct::backend::ffi] Missing HTTP status
May 18 10:06:13 ubuntu-virtio systemd[1763]: snap.firefox.firefox.9a459d4d-64ee-447a-a167-9ed25de787f1.scope: Consumed 44.944s CPU time.
May 18 10:06:15 ubuntu-virtio snapd[907]: storehelpers.go:769: cannot refresh: snap has no updates available: "authy", "bare", "btop", "certbot", "cheat", "core", "core18", "core20", "core22", "cups", "firefox", "gedit", "gnome-3-28-1804", "gnome-3-38-2004", "gnome-42-2204", "gtk-common-themes", "helm", ">
May 18 10:06:22 ubuntu-virtio sudo[9194]: tim : TTY=pts/0 ; PWD=/home/tim ; USER=root ; COMMAND=/usr/bin/snap refresh --list
May 18 10:06:22 ubuntu-virtio sudo[9194]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
May 18 10:06:24 ubuntu-virtio snapd[907]: storehelpers.go:769: cannot refresh: snap has no updates available: "authy", "bare", "btop", "certbot", "cheat", "core", "core18", "core20", "core22", "cups", "gedit", "gnome-3-28-1804", "gnome-3-38-2004", "gnome-42-2204", "gtk-common-themes", "helm", "hunspell-di>
May 18 10:06:24 ubuntu-virtio sudo[9194]: pam_unix(sudo:session): session closed for user root
May 18 10:06:24 ubuntu-virtio systemd[1763]: Started snap.kubectl.kubectl.19142528-be7a-4a40-9636-3460a379f917.scope.
May 18 10:06:46 ubuntu-virtio systemd[1763]: Started Application launched by gnome-shell.
May 18 10:06:46 ubuntu-virtio systemd[1763]: Started snap.firefox.firefox.d096df4e-e588-4c6a-b1fa-92801f86ef7d.scope.
May 18 10:06:46 ubuntu-virtio firefox[9248]: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
May 18 10:06:46 ubuntu-virtio audit[9248]: SECCOMP auid=1000 uid=1000 gid=1000 ses=3 subj=snap.firefox.firefox pid=9248 comm="firefox" exe="/snap/firefox/2677/usr/lib/firefox/firefox" sig=0 arch=c000003e syscall=314 compat=0 ip=0x7fcf067c473d code=0x50000
May 18 10:06:46 ubuntu-virtio kernel: audit: type=1326 audit(1684368406.109:134): auid=1000 uid=1000 gid=1000 ses=3 subj=snap.firefox.firefox pid=9248 comm="firefox" exe="/snap/firefox/2677/usr/lib/firefox/firefox" sig=0 arch=c000003e syscall=314 compat=0 ip=0x7fcf067c473d code=0x50000
May 18 10:06:46 ubuntu-virtio firefox_firefox.desktop[9248]: [GFX1-]: vaapitest: ERROR
May 18 10:06:46 ubuntu-virtio firefox_firefox.desktop[9248]: [GFX1-]: vaapitest: VA-API test failed: failed to initialise VAAPI connection.
May 18 10...

Revision history for this message
Tim Richardson (tim-richardson) wrote :

For the first time, I have seen it work, on a 22.04 desktop with snap 2.59.4.
The only thing I did was to reset firefox via that option in Firefox help, and remove the KDE Plamsa extension based on it occuring in the journalctl -e output above.

It worked quickly.

I will try that elsewhere.

Revision history for this message
Miguel Pires (miguelpires1) wrote :

Hi. I think this is happening because firefox leaves processes hanging in its cgroup scope which means snapd can't detect it has closed and refresh it (see: https://forum.snapcraft.io/t/close-the-app-to-avoid-disruptions-for-a-closed-app/34291/5?u=miguelpires). If this happens again, you can check if that's the case by running `systemctl status` and checking if there's still a cgroup scope for the snap.

Revision history for this message
Tim Richardson (tim-richardson) wrote : Re: [Bug 2019158] Re: snap 2.59.2 is not doing updates automatically

Will do. at one point I meticulously checked all the processes reported by
snap as blocking,; they had all exited but still the update did not trigger.

For debugging, it is ok for me to do a snap revert to go back to a prior
version in order to simulate a pending update?

On Thu, 18 May 2023, 20:21 Miguel Pires, <email address hidden> wrote:

> Hi. I think this is happening because firefox leaves processes hanging
> in its cgroup scope which means snapd can't detect it has closed and
> refresh it (see: https://forum.snapcraft.io/t/close-the-app-to-avoid-
> disruptions-for-a-closed-app/34291/5?u=miguelpires
> <https://forum.snapcraft.io/t/close-the-app-to-avoid-disruptions-for-a-closed-app/34291/5?u=miguelpires>).
> If this happens
> again, you can check if that's the case by running `systemctl status`
> and checking if there's still a cgroup scope for the snap.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2019158
>
> Title:
> snap 2.59.2 is not doing updates automatically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>
>

Revision history for this message
Tim Richardson (tim-richardson) wrote (last edit ): Re: snap 2.59.2 is not doing updates automatically

On all three of my desktops where I have Firefox beta the auto refresh worked as expected just now. This is using snap 2.59.4.

The only change was to remove the KDE Plasma Integration extension and do a firefox refresh.
This might indicate that this fixed a problem related to hanging processes, although previously I meticulously killed all the nominates processes blocking the update (all of which were already gone after quitting firefox).

It is fun and excellent to see the update working as advertised. So cool.

Revision history for this message
Tim Richardson (tim-richardson) wrote :

I will reinstall that extension on the VM I have dedicated to this, just to see if I can reproduce the original problem.

Revision history for this message
Miguel Pires (miguelpires1) wrote :
Changed in snapd:
status: New → Invalid
Changed in snapd:
importance: Undecided → Critical
importance: Critical → Wishlist
Changed in snapd:
assignee: nobody → Miguel Pires (miguelpires1)
importance: Wishlist → High
status: Invalid → Incomplete
Revision history for this message
Tim Richardson (tim-richardson) wrote :
Revision history for this message
Tim Richardson (tim-richardson) wrote :

With respect to this comment, logs are attached:

This is very frustrating. My firefox beta is stuck on 115.0b4 (64-bit)

but

tim@yellow:~$ snap refresh --list
Name Version Rev Size Publisher Notes
firefox 115.0b6-1 2786 257MB mozilla✓ -

so I am now two version behind. I got the desktop notification for 115.0b5 but as I said above, the update did not actually happen. And now I get no more notifications. Why not? So what happens now? I have set the snap refresh time to every hour but still no notifications.

snap changes actually did things today, but it just ignored firefox, why?

snap changes
ID Status Spawn Ready Summary
248 Done yesterday at 19:43 AEST yesterday at 19:43 AEST Auto-refresh snap "firmware-updater"
249 Done today at 10:22 AEST today at 10:22 AEST Change configuration of "core" snap
250 Done today at 10:22 AEST today at 10:23 AEST Auto-refresh snaps "code", "snapd"

Revision history for this message
Tim Richardson (tim-richardson) wrote :

My snap has updated to 2.60
The same problem just happened again with Firefox beta. I received a desktop notification.
shap changes indicates that it has done the predownload.
But the update does not happen.

[~] [cultiver@eks] $ snap changes
ID Status Spawn Ready Summary
437 Done today at 04:34 AEST today at 04:34 AEST Auto-refresh snap "cups"
438 Done today at 11:54 AEST today at 11:54 AEST Auto-refresh snap "core20"
439 Done today at 13:04 AEST today at 13:04 AEST Pre-download "firefox" for auto-refresh

[~] [cultiver@eks] $ snap info firefox
name: firefox
summary: Mozilla Firefox web browser
publisher: Mozilla\u2713
store-url: https://snapcraft.io/firefox
contact: https://support.mozilla.org/kb/file-bug-report-or-feature-request-mozilla
license: unset
description: |
  Firefox is a powerful, extensible web browser with support for modern web
  application technologies.
commands:
  - firefox
  - firefox.geckodriver
snap-id: 3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk
tracking: latest/beta
refresh-date: 2 days ago, at 16:59 AEST
channels:
  latest/stable: 114.0.1-1 2023-06-09 (2760) 256MB -
  latest/candidate: 114.0.1-1 2023-06-09 (2760) 256MB -
  latest/beta: 115.0b7-1 2023-06-19 (2794) 256MB -
  latest/edge: 116.0a1 2023-06-18 (2793) 262MB -
  esr/stable: 102.12.0esr-1 2023-06-06 (2735) 186MB -
  esr/candidate: 102.12.0esr-1 2023-05-29 (2735) 186MB -
  esr/beta: \u2191
  esr/edge: \u2191
installed: 115.0b6-1 (2786) 257MB -
[~] [cultiver@eks] $ # will now close firefox
[~] [cultiver@eks] $ snap changes
ID Status Spawn Ready Summary
437 Done today at 04:34 AEST today at 04:34 AEST Auto-refresh snap "cups"
438 Done today at 11:54 AEST today at 11:54 AEST Auto-refresh snap "core20"
439 Done today at 13:04 AEST today at 13:04 AEST Pre-download "firefox" for auto-refresh

[~] [cultiver@eks] $ snap refresh --list
Name Version Rev Size Publisher Notes
firefox 115.0b7-1 2794 256MB mozilla\u2713 -
[~] [cultiver@eks] $ snap --version
snap 2.60
snapd 2.60
series 16
ubuntu 22.04
kernel 5.19.0-45-generic

Revision history for this message
Tim Richardson (tim-richardson) wrote (last edit ):

by the way, when I did a manual sudo snap refresh, the download progress indicator indicated that the entire snap was downloaded, not that it was cached or already available. If the snap changes preload was true (it said)

439 Done today at 13:04 AEST today at 13:04 AEST Pre-download "firefox" for auto-refresh

why would the manual snap refresh download the snap (again)? Does this imply that the pre-download did not download anything?

Revision history for this message
Miguel Pires (miguelpires1) wrote :

Thank you for the logs and the confirmation. I don't see anything out of the ordinary in the logs. Can you use `sudo systemctl edit snapd.service` (which will open an editor) to add the lines:
[Service]
Environment="SNAPD_DEBUG=1"
Environment="SNAPD_DEBUG_HTTP=3"

to snapd's override? This will add more information to the logs. Also, when this problem happens again can you run:
{ snap changes; sudo snap debug stacktraces; systemctl status --no-pager; } > snapd.log

Then close snapd with `systemctl stop snapd.{service,socket}`, copy the file `/var/lib/snapd/state.json` and send that file and the snapd.log file with the logs to me at `<email address hidden>`? Thank you.

To answer your question, the fact that the snap was downloaded again doesn't necessarily imply that it wasn't downloaded in the first place. This is because during an installation or refresh the downloaded snap is moved out of the cache. In that case, I'd expect there to be an auto-refresh attempt after the pre-download (even if it fails for some reason) but it seems like there isn't one. With the debug logs, we'll be able to get a better idea of what's happening.

Revision history for this message
Tim Richardson (tim-richardson) wrote : Re: [Bug 2019158] Re: snap 2.59.2 is not doing updates automatically

Thanks. For 22.04 I have done that, adding the debug messages worked so now
I wait for the next firefox beta update.

 I also have a 23.04 VM which I am using to help with this bug.
Currently the firefox beta snap is 115.0b4 (so it is several releases
behind).
Hopefully at some point it will get the notification and I will have
another "test point"

Regarding setting up the debugging: On 23.04
 when I do:

sudo systemctl edit snapd.service

I consistently get this error when exiting the editor:
Editing "/etc/systemd/system/snapd.service.d/override.conf" canceled:
temporary file is empty.

It happens even when I explicitly save my changes before exiting the
editor.

and my changes are not saved. This VM defaulted to nano and it had this
problem. I changed the default editor to vim.tiny and had the same problem.
Google and chatgpt don't have useful answers.

On Mon, 19 Jun 2023 at 21:45, Miguel Pires <email address hidden>
wrote:

> Thank you for the logs and the confirmation. I don't see anything out of
> the ordinary in the logs. Can you use `sudo systemctl edit snapd.service`
> (which will open an editor) to add the lines:
> [Service]
> Environment="SNAPD_DEBUG=1"
> Environment="SNAPD_DEBUG_HTTP=3"
>
> to snapd's override? This will add more information to the logs. Also,
> when this problem happens again can you run:
> { snap changes; sudo snap debug stacktraces; systemctl status --no-pager;
> } > snapd.log
>
> Then close snapd with `systemctl stop snapd.{service,socket}`, copy the
> file `/var/lib/snapd/state.json` and send that file and the snapd.log
> file with the logs to me at `<email address hidden>`? Thank you.
>
> To answer your question, the fact that the snap was downloaded again
> doesn't necessarily imply that it wasn't downloaded in the first place.
> This is because during an installation or refresh the downloaded snap is
> moved out of the cache. In that case, I'd expect there to be an auto-
> refresh attempt after the pre-download (even if it fails for some
> reason) but it seems like there isn't one. With the debug logs, we'll be
> able to get a better idea of what's happening.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2019158
>
> Title:
> snap 2.59.2 is not doing updates automatically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>
>

--
Tim Richardson

Revision history for this message
Tim Richardson (tim-richardson) wrote :

using

systemctl show -p FragmentPath snapd.service

I found the file and edited it manually.
I have reported a bug to the systemd package
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2024406

On Tue, 20 Jun 2023 at 08:05, Tim Richardson <email address hidden> wrote:

> Thanks. For 22.04 I have done that, adding the debug messages worked so
> now I wait for the next firefox beta update.
>
> I also have a 23.04 VM which I am using to help with this bug.
> Currently the firefox beta snap is 115.0b4 (so it is several releases
> behind).
> Hopefully at some point it will get the notification and I will have
> another "test point"
>
> Regarding setting up the debugging: On 23.04
> when I do:
>
> sudo systemctl edit snapd.service
>
> I consistently get this error when exiting the editor:
> Editing "/etc/systemd/system/snapd.service.d/override.conf" canceled:
> temporary file is empty.
>
> It happens even when I explicitly save my changes before exiting the
> editor.
>
> and my changes are not saved. This VM defaulted to nano and it had this
> problem. I changed the default editor to vim.tiny and had the same problem.
> Google and chatgpt don't have useful answers.
>
>
> On Mon, 19 Jun 2023 at 21:45, Miguel Pires <email address hidden>
> wrote:
>
>> Thank you for the logs and the confirmation. I don't see anything out of
>> the ordinary in the logs. Can you use `sudo systemctl edit snapd.service`
>> (which will open an editor) to add the lines:
>> [Service]
>> Environment="SNAPD_DEBUG=1"
>> Environment="SNAPD_DEBUG_HTTP=3"
>>
>> to snapd's override? This will add more information to the logs. Also,
>> when this problem happens again can you run:
>> { snap changes; sudo snap debug stacktraces; systemctl status --no-pager;
>> } > snapd.log
>>
>> Then close snapd with `systemctl stop snapd.{service,socket}`, copy the
>> file `/var/lib/snapd/state.json` and send that file and the snapd.log
>> file with the logs to me at `<email address hidden>`? Thank you.
>>
>> To answer your question, the fact that the snap was downloaded again
>> doesn't necessarily imply that it wasn't downloaded in the first place.
>> This is because during an installation or refresh the downloaded snap is
>> moved out of the cache. In that case, I'd expect there to be an auto-
>> refresh attempt after the pre-download (even if it fails for some
>> reason) but it seems like there isn't one. With the debug logs, we'll be
>> able to get a better idea of what's happening.
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/2019158
>>
>> Title:
>> snap 2.59.2 is not doing updates automatically
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>>
>>
>
> --
> Tim Richardson
>

--
Tim Richardson

Revision history for this message
Miguel Pires (miguelpires1) wrote (last edit ): Re: snap 2.59.2 is not doing updates automatically

I just got this issue on my machine. Turns out the first guess was correct, the first auto-refresh returns the new snap but the auto-refresh triggered by closing the snap doesn't. I've spoken to the store team again who have confirmed that this is possible, despite what was thought before. Apparently firefox doesn't use phasing but there is a throttling mechanism that might cause subsequent requests to the store to get different results. I'll keep this report updated as we work on and release the fix. Thank you for your help.

Changed in snapd:
status: Incomplete → Confirmed
Revision history for this message
Tim Richardson (tim-richardson) wrote :

Problem again. Not sure if these reports are still useful. While your hypothesis or information is that a throttling problem "might" cause this problem, I can not remember the last time I had a successful update. I guessing that if it works one time in ten, I am being generous. So for me at least, it is almost completely broken.

Revision history for this message
Tim Richardson (tim-richardson) wrote :

journalct output

Revision history for this message
Tim Richardson (tim-richardson) wrote :

snapd log with debugging options set

Revision history for this message
Miguel Pires (miguelpires1) wrote :

I've opened https://github.com/snapcore/snapd/pull/12970 to address this issue. https://github.com/snapcore/snapd/pull/12946 and https://github.com/snapcore/snapd/pull/12947 have been merged and were pre-requisites to the first one.

Changed in snapd:
status: Confirmed → In Progress
Revision history for this message
Tim Richardson (tim-richardson) wrote : Re: [Bug 2019158] Re: snap 2.59.2 is not doing updates automatically

Thanks for giving an update. I look forward to the fix.

On Tue, 11 July 2023, 02:40 Miguel Pires, <email address hidden>
wrote:

> I've opened https://github.com/snapcore/snapd/pull/12970 to address this
> issue. https://github.com/snapcore/snapd/pull/12946 and
> https://github.com/snapcore/snapd/pull/12947 have been merged and were
> pre-requisites to the first one.
>
> ** Changed in: snapd
> Status: Confirmed => In Progress
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2019158
>
> Title:
> snap 2.59.2 is not doing updates automatically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>
>

Changed in snapd:
status: In Progress → Fix Committed
summary: - snap 2.59.2 is not doing updates automatically
+ snap 2.59.2 is not doing Firefox updates automatically
Revision history for this message
Miguel Pires (miguelpires1) wrote :

Hi Tim. This should be fixed in edge so if you're tracking that branch of snapd, you should see the correct behaviour now. If not, please let me know if you can. Thanks

Revision history for this message
Tim Richardson (tim-richardson) wrote : Re: [Bug 2019158] Re: snap 2.59.2 is not doing Firefox updates automatically

Thanks. I'm using the nightly git channel and I'll wait for a Firefox
update ...

On Mon, 31 July 2023, 23:21 Miguel Pires, <email address hidden>
wrote:

> Hi Tim. This should be fixed in edge so if you're tracking that branch
> of snapd, you should see the correct behaviour now. If not, please let
> me know if you can. Thanks
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2019158
>
> Title:
> snap 2.59.2 is not doing Firefox updates automatically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>
>

Revision history for this message
Tim Richardson (tim-richardson) wrote :

I just got the first success on kubuntu 23.10 with the latest update on the firefox beta channel. So that is 1 out of 1 so far. Thanks, it is fun to see it working.

Revision history for this message
Tim Richardson (tim-richardson) wrote :

two out of two: it worked on an ubuntu 22.04 VM (with latest snapd edge)

On Thu, 3 Aug 2023 at 09:36, Tim Richardson <email address hidden>
wrote:

> I just got the first success on kubuntu 23.10 with the latest update on
> the firefox beta channel. So that is 1 out of 1 so far. Thanks, it is
> fun to see it working.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2019158
>
> Title:
> snap 2.59.2 is not doing Firefox updates automatically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>
>

--
Tim Richardson

Revision history for this message
reisig (reisig) wrote :

I'm wondering when the fix is rolled out to snapd/stable. My firefox snap was still not auto-updated from 116.0.3 and I have seen delays of a month+ on some machines.

Revision history for this message
Tim Richardson (tim-richardson) wrote :

I forgot to update this bug report, but it is working reliably for me now.
In the process of reporting and following this, I updated my snapd to the
channel latest/beta and I have not reverted to stable.

However, on 22.04 snap info snapd tells me that the stable channel is
2.60.3 so you should be on that, and this version definitely has the bug
fix tracked by this report.

The bug was specifically about how an available update responded to Firefox
being open and then closed in response to the notification.

If you are not getting the update notifications in the first place, it's a
different problem, I guess.

On Mon, 11 Sept 2023 at 12:01, reisig <email address hidden> wrote:

> I'm wondering when the fix is rolled out to snapd/stable. My firefox
> snap was still not auto-updated from 116.0.3 and I have seen delays of a
> month+ on some machines.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2019158
>
> Title:
> snap 2.59.2 is not doing Firefox updates automatically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>
>

--
Tim Richardson

Revision history for this message
Miguel Pires (miguelpires1) wrote :

Hi. This fix is currently only on latest/edge. It will be in 2.61 which is scheduled to be released in some a few weeks.
As Tim said, this bug is only about the closing of the Firefox not triggering a new auto-refresh after a notification. If that's not the case, then it might be something else which is worth exploring in a new bug report.
Also, thanks Tim for confirming that this is working as intended now.

Revision history for this message
Tim Richardson (tim-richardson) wrote :

so much for "definitely". However, I have been on latest/beta and it has
been working. latest/beta reports as 2.60.3.
I did spend time on latest/edge and it was completely stable.

On Tue, 12 Sept 2023 at 18:51, Miguel Pires <email address hidden>
wrote:

> Hi. This fix is currently only on latest/edge. It will be in 2.61 which is
> scheduled to be released in some a few weeks.
> As Tim said, this bug is only about the closing of the Firefox not
> triggering a new auto-refresh after a notification. If that's not the case,
> then it might be something else which is worth exploring in a new bug
> report.
> Also, thanks Tim for confirming that this is working as intended now.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/2019158
>
> Title:
> snap 2.59.2 is not doing Firefox updates automatically
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snapd/+bug/2019158/+subscriptions
>
>

--
Tim Richardson

Revision history for this message
reisig (reisig) wrote :

Thank you both for your answers.

My issue seen on 2 Ubuntu 22.04 systems:
While firefox is running I usually have one update notification and the snap is downloaded. Then this snap revision will not be installed after closing firefox or later on regular snapd auto-update checks (FF open = no notification; FF not running = no update). It seems like if the first auto-update failed, that revision is ignored afterwards.

The failed revisions pile up:
/var/lib/snapd/snaps/firefox_2800.snap
/var/lib/snapd/snaps/firefox_2971.snap
/var/lib/snapd/snaps/firefox_2987.snap
/var/lib/snapd/snaps/firefox_3026.snap
/var/lib/snapd/snaps/firefox_3068.snap

snap list --all:
firefox 116.0.2-1 2987 latest/stable mozilla✓ disabled
firefox 116.0.3-2 3026 latest/stable mozilla✓ -

I thought it matches this bugs description (and Tim's comment #15).

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.