My snaps are not updating

We have this set:

sudo snap set system refresh.timer=00:00~24:00/1440

But snaps on system are old.

When I try:

snap refresh

It gives me that all snap are up-to-date.

When I try:

snap refresh our_own_snap_hosted_at_snapcraft

Then it offers an update.

What is going on?

root@pc-G6JY21900E16:/usr/local/mesh_services/meshagent# snap info snapname
name:      snapname
...
tracking:     latest/stable
refresh-date: 45 days ago, at 04:51 CEST
installed:    1.12.8 (74) 97MB soukromé

root@pc-G6JY21900E16:/usr/local/mesh_services/meshagent# snap refresh
Všechny snapy jsou aktuální

root@pc-G6JY21900E16:/usr/local/mesh_services/meshagent# snap refresh --list
Name                         Version  Rev  Size  Publisher  Notes
snapname  1.13.0   75   78MB  authorname  soukromé

Even when app is turned off, it doesn’t update, I need to manually call snap refresh when app is not running.

One minute refresh /1440 seems to be broken, next date tame stays in the past.

root@pc-G6JY21300KLW:/usr/local/mesh_services/meshagent# date
Ne 16. října 2022, 13:00:26 CEST
root@pc-G6JY21300KLW:/usr/local/mesh_services/meshagent# snap refresh --time
timer: 00:00~24:00/1440
last: dnes v 12:51 CEST
next: dnes v 12:59 CEST

Seems like anything above /23 shows next as this current minute or in the past.

But even if there is a future date, like 13:06 when the time is 13:05, it doesn’t refresh my snap.

Might be related? I saw n/a when I came to it.

root@pc-G6JY220009ZS:/usr/local/mesh_services/meshagent# date
Po 17. října 2022, 13:02:21 CEST
root@pc-G6JY220009ZS:/usr/local/mesh_services/meshagent# snap refresh --time
timer: 00:00~24:00/1440
last: dnes v 12:46 CEST
next: dnes v 12:51 CEST

Why is the next lower than current time?

it looks like there are still some weird edge cases:

$ snap refresh --time
timer: 00:00~24:00/4
last: 2 days ago, at 00:01 CEST
next: 2 days ago, at 10:20 CEST
$ snap version
snap    2.62
snapd   2.62
series  16
ubuntu  22.04
kernel  6.5.0-28-generic

Have you restarted the snapd service like suggested in bug report?

sudo systemctl restart snapd

What you see in the status of snapd.service

systemctl status snapd.service

I see some strange things like:

snapd.service: Got notification message from PID 80291, but reception only permitted for main PID 79964
maj 10 23:16:42 pc systemd[1]: snapd.service: Got notification message from PID 80292, but reception only permitted for main PID 79964
maj 10 23:16:42 pc systemd[1]: snapd.service: Got notification message from PID 80293, but reception only permitted for main PID 79964
maj 10 23:16:42 pc systemd[1]: snapd.service: Got notification message from PID 80294, but reception only permitted for main PID 79964
maj 10 23:16:42 pc systemd[1]: snapd.service: Got notification message from PID 80295, but reception only permitted for main PID 79964
maj 10 23:16:43 pc systemd[1]: snapd.service: Got notification message from PID 80296, but reception only permitted for main PID 79964
maj 10 23:16:43 pc snapd[79964]: hotplug.go:200: hotplug device add event ignored, enable experimental.hotplug

Also when checking the refresh time have you seen the n/a appearing as the next date. I’ve seen it a couple times.

Are you on 22.04 (previous LTS) like @mrk ? I’m running 23.10 and don’t have that timer problem… but I’ve started my system recently, and I suppose @mrk, and maybe you, have a much higher uptime.

$ LANG=C snap refresh --time
timer: 00:00~24:00/4
last: today at 18:52 CEST
next: tomorrow at 02:55 CEST
$ snap version
snap    2.62
snapd   2.62
series  16
ubuntu  23.10
kernel  6.5.0-28-generic

I’m on 24.04 LTS and my uptime isn’t higher then several hours.

I turn my computer off when I won’t be using it.

24.04 already ? So it must be either a fresh install or a forced upgrade, because upgrades aren’t available yet, not even for 23.10.

yup, I restarted snapd.service 4 days ago but nothing changed/improved. edit: sorry topics got mixed, I thought I am replying in the other one. No,I did not restart snapd since I saw that next time is showing past time. I suspect that would help, but it is not really helpful to solving the underlying issue (I may provide some debug info if needed)

$ snap info firefox
name:      firefox
summary:   Mozilla Firefox web browser
publisher: Mozilla✓
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
refresh-date: 28 days ago, at 00:15 CEST
channels:
  latest/stable:    125.0.3-1     2024-04-29 (4209) 282MB -
  latest/candidate: 126.0-2       2024-05-10 (4259) 283MB -
  latest/beta:      126.0b9-1     2024-05-06 (4246) 284MB -
  latest/edge:      127.0a1       2024-05-10 (4261) 301MB -
  esr/stable:       115.10.0esr-1 2024-04-16 (4126) 256MB -
  esr/candidate:    115.11.0esr-1 2024-05-06 (4244) 257MB -
  esr/beta:         ↑                                     
  esr/edge:         ↑                                     
installed:          124.0.2-1                (4090) 281MB -

snap refresh --list shows firefox as having pending update:

$ snap refresh --list
Name      Version         Rev   Size   Publisher      Notes
chromium  124.0.6367.155  2846  169MB  canonical✓     -
code      dc96b837        159   326MB  vscode✓        classic
firefox   125.0.3-1       4209  282MB  mozilla✓       -
gimp      2.10.38         436   540MB  snapcrafters✪  -

hmm I don’t recall seeing n/a. I only recall that I was lately observing snap refresh --time output, and refresh was not really happening when ‘next’ refresh time was due. And only today I started observing that next time is showing past time

$ snap changes
ID   Status  Spawn                      Ready                      Summary
503  Done    3 days ago, at 00:01 CEST  3 days ago, at 00:01 CEST  Auto-refresh snap "bitwarden"

$ snap refresh --time
timer: 00:00~24:00/4
last: 3 days ago, at 00:01 CEST
next: 3 days ago, at 10:20 CEST

20 days uptime, but my computer usage is multiple suspends a day. I suspend basically every time I am afk

Ah, the suspends… I perfectly understand that people suspend their computers, after all, that feature has been available for a looong time, and should be working well by now… but I’ve stopped doing suspends, as I’ve seen problems still occurring, not only in software but even hardware sometimes. So for me it’s either complete shutdown or it remains fully up. When it’s not in use my computer consumes less than 20W anyway (and I generally shut it down before going to bed).

Maybe you could try having your system run with no suspends for, say, one week to see how it goes with the timers. I’m not necessarily blaming the suspends in that very instance, it could be that snapd hasn’t been properly programmed to recover from suspends.

I’ve had the n/a appear again today.

snap refresh --time
timer: 00:00~24:00/4
last: today at 00:07 CEST
next: n/a

Firefox, Chromium still haven’t been updated, but snap-store had an update.

Finally Chromium has been updated.

Only Firefox left, so maybe it will eventually also get the update.