/srv/irclogs.ubuntu.com/2023/10/12/#ubuntu-desktop.txt

seb128goood morning desktopers!07:37
lissyxseb128, hello08:02
lissyxseb128, FTR https://bugs.launchpad.net/snapd/+bug/203905208:03
seb128lissyx, hey, how are you?08:03
-ubottu:#ubuntu-desktop- Launchpad bug 2039052 in snapd "blocking refresh does not block auto-refresh" [Undecided, New]08:03
seb128lissyx, I don't understand what is described in there08:15
seb128lissyx, do you mean you would expect the hold to make snapd refuse the manual sudo snap install --dangerous?08:15
lissyxseb128, all I see is I instructed snapd to hold refreshes for 24h and when I perform the next step, it does a refresh08:20
lissyxseb128, that sounds like a bug to me08:20
lissyxand at best an undocumented behavior because I have searched docs on that matter and found nothing08:21
seb128where does it do a refresh?08:21
seb128 > [task 2023-10-10T15:05:08.798Z] + sudo snap install --name firefox --dangerous ./firefox.snap08:21
seb128that's the end of the log?08:21
seb128you manually call an install, what would you expect? a reject msg?08:21
lissyxhttps://treeherder.mozilla.org/logviewer?job_id=431990807&repo=try&lineNumber=80-8308:22
seb128oh08:22
lissyxlooks like copy/pasting cut one line08:22
seb128ok, without the line the report didn't make sense08:22
lissyxyeah sorry, I fixed it08:22
seb128are you sure the auto-refresh was not already started when you called the hold cmd?08:23
seb128you could argue than calling hold should discontinue a started refresh08:23
seb128my guess is that it's what is happening there08:23
lissyxeither way, it's a bug08:25
lissyxif auto-refresh was already in progress, my hold request should either cancel it or fail08:25
lissyxnot succeed and then blow like that08:25
lissyxI have not seen a way to block auto-refresh vs refresh08:26
lissyx(for now I'm going to force a refresh before)08:26
seb128I'm unsure what you mean auto-refresh vs refresh08:26
seb128you mean as a sysadmin you want to forbid refresh even done manually from a sudo user?08:27
seb128hold is meant to stop the snap refreshing under your control08:27
seb128under->outside08:27
lissyxpart of the problem is actually I could not find accurate docs on auto-refresh08:28
seb128I think snapd just don't handle great 'conflicting' request08:28
lissyxuntil I find some, I assume that holding "refresh" should also impact "auto-refresh"08:28
seb128or isn't able to discard a started auto-refresh08:28
seb128you see it also from report like https://askubuntu.com/questions/1167566/snap-not-allowing-me-to-remove-or-refresh-anything08:28
seb128what do you call 'refresh'?08:29
lissyxwhatever this is doing: snap refresh --hold=24h firefox08:29
seb128I'm not a snapd expert but my understanding is that there is only 'auto-refresh'08:29
seb128refresh --hold is telling snapd to not update the snap for you during that time08:29
seb128so basically inhibiting autorefresh for a period08:30
seb128there is no 'refresh' concept outside of you calling sudo snap refresh manually08:30
seb128but then holding that wouldn't make sense08:30
seb128just don't run that cmd :p08:30
seb128https://snapcraft.io/docs/keeping-snaps-up-to-date08:31
seb128```08:31
seb128The refresh hold is:08:31
seb128    Effective on auto-refreshes and general snap refresh requests08:31
seb128    Not effective on targeted snap refreshes08:31
seb128```08:31
seb128$ snap refresh -h08:32
seb128Usage:08:32
seb128  snap refresh [refresh-OPTIONS] [<snap>...]08:32
seb128The refresh command updates the specified snaps, or all snaps in the system if08:32
seb128none are specified.08:32
seb128 08:32
seb128so basically refresh --hold blocks the auto-refresh in background08:32
seb128and exclude the snap from a 'snap refresh' call08:32
seb128but if you snap refresh <snapname> then it's not blocked08:32
seb128and I think your error is due to the fact that an auto-refresh was already started by the time you call the hold cmd08:33
seb128and snapd isn't smart enough to handle an install request where there is already a transition ongoing, as also mentioned in that askubuntu 'can't remove snap being refresh' post I shared08:34
lissyxwell this needs fixing in a way :p08:34
seb128lissyx, it's tricky, I think telling you that there is already an active transaction for that snap is ok08:40
seb128but maybe it should ask you if you want to cancel/replace with the one you try to install08:40
seb128or block//wait on the current transaction to be over then do the install (but then it would be a blocking call and I don't know if the snapd team want snap calls to be potentially blocking)08:41
seb128lissyx, to fix the CI you can probably check the 'snap changes' status before calling the install08:42
lissyxI am just forcing a refresh08:42
seb128if there is a firefox auto-refresh entry then sleep & retry until it's fdone08:42
lissyxlike it's not a big deal.08:42
lissyxI just felt it was awkward and needed an upstream fix, whatever the fix would be08:43
seb128well, it's like if you try to dpkg -i a deb while a dist-upgrade is ongoing08:43
seb128dpkg is going to tell you there is a lock in place and bail out08:43
seb128that's the snap equivalent08:44
seb128I think nowadays apt does the 'display a warning that it can't get the lock, sleep and try again until it can get the lock'08:44
seb128snap should probably learn to do something similar08:45
lissyxI think as long as there's a "snap refresh hold" option, it's different08:45
lissyxand either snap should gracefully honor it and cancel a pending auto-refresh, or explicitely fail "cannot hold with auto-refresh in progress"08:45
seb128fair enough08:51
seb128it should at least warn you at the time of the hold if there is an ongoing refresh08:51
luna-23.10 time :)14:14
luna-https://releases.ubuntu.com/23.10/ubuntu-23.10-desktop-amd64.iso16:05

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!