[07:37] <seb128> goood morning desktopers!
[08:02] <lissyx> seb128, hello
[08:03] <lissyx> seb128, FTR https://bugs.launchpad.net/snapd/+bug/2039052
[08:03] <seb128> lissyx, hey, how are you?
[08:03] -ubottu:#ubuntu-desktop- Launchpad bug 2039052 in snapd "blocking refresh does not block auto-refresh" [Undecided, New]
[08:15] <seb128> lissyx, I don't understand what is described in there
[08:15] <seb128> lissyx, do you mean you would expect the hold to make snapd refuse the manual sudo snap install --dangerous?
[08:20] <lissyx> seb128, all I see is I instructed snapd to hold refreshes for 24h and when I perform the next step, it does a refresh
[08:20] <lissyx> seb128, that sounds like a bug to me
[08:21] <lissyx> and at best an undocumented behavior because I have searched docs on that matter and found nothing
[08:21] <seb128> where does it do a refresh?
[08:21] <seb128>  > [task 2023-10-10T15:05:08.798Z] + sudo snap install --name firefox --dangerous ./firefox.snap
[08:21] <seb128> that's the end of the log?
[08:21] <seb128> you manually call an install, what would you expect? a reject msg?
[08:22] <lissyx> https://treeherder.mozilla.org/logviewer?job_id=431990807&repo=try&lineNumber=80-83
[08:22] <seb128> oh
[08:22] <lissyx> looks like copy/pasting cut one line
[08:22] <seb128> ok, without the line the report didn't make sense
[08:22] <lissyx> yeah sorry, I fixed it
[08:23] <seb128> are you sure the auto-refresh was not already started when you called the hold cmd?
[08:23] <seb128> you could argue than calling hold should discontinue a started refresh
[08:23] <seb128> my guess is that it's what is happening there
[08:25] <lissyx> either way, it's a bug
[08:25] <lissyx> if auto-refresh was already in progress, my hold request should either cancel it or fail
[08:25] <lissyx> not succeed and then blow like that
[08:26] <lissyx> I have not seen a way to block auto-refresh vs refresh
[08:26] <lissyx> (for now I'm going to force a refresh before)
[08:26] <seb128> I'm unsure what you mean auto-refresh vs refresh
[08:27] <seb128> you mean as a sysadmin you want to forbid refresh even done manually from a sudo user?
[08:27] <seb128> hold is meant to stop the snap refreshing under your control
[08:27] <seb128> under->outside
[08:28] <lissyx> part of the problem is actually I could not find accurate docs on auto-refresh
[08:28] <seb128> I think snapd just don't handle great 'conflicting' request
[08:28] <lissyx> until I find some, I assume that holding "refresh" should also impact "auto-refresh"
[08:28] <seb128> or isn't able to discard a started auto-refresh
[08:28] <seb128> you see it also from report like https://askubuntu.com/questions/1167566/snap-not-allowing-me-to-remove-or-refresh-anything
[08:29] <seb128> what do you call 'refresh'?
[08:29] <lissyx> whatever this is doing: snap refresh --hold=24h firefox
[08:29] <seb128> I'm not a snapd expert but my understanding is that there is only 'auto-refresh'
[08:29] <seb128> refresh --hold is telling snapd to not update the snap for you during that time
[08:30] <seb128> so basically inhibiting autorefresh for a period
[08:30] <seb128> there is no 'refresh' concept outside of you calling sudo snap refresh manually
[08:30] <seb128> but then holding that wouldn't make sense
[08:30] <seb128> just don't run that cmd :p
[08:31] <seb128> https://snapcraft.io/docs/keeping-snaps-up-to-date
[08:31] <seb128> ```
[08:31] <seb128> The refresh hold is:
[08:31] <seb128>     Effective on auto-refreshes and general snap refresh requests
[08:31] <seb128>     Not effective on targeted snap refreshes
[08:31] <seb128> ```
[08:32] <seb128> $ snap refresh -h
[08:32] <seb128> Usage:
[08:32] <seb128>   snap refresh [refresh-OPTIONS] [<snap>...]
[08:32] <seb128> The refresh command updates the specified snaps, or all snaps in the system if
[08:32] <seb128> none are specified.
[08:32] <seb128>  
[08:32] <seb128> so basically refresh --hold blocks the auto-refresh in background
[08:32] <seb128> and exclude the snap from a 'snap refresh' call
[08:32] <seb128> but if you snap refresh <snapname> then it's not blocked
[08:33] <seb128> and I think your error is due to the fact that an auto-refresh was already started by the time you call the hold cmd
[08:34] <seb128> and 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 shared
[08:34] <lissyx> well this needs fixing in a way :p
[08:40] <seb128> lissyx, it's tricky, I think telling you that there is already an active transaction for that snap is ok
[08:40] <seb128> but maybe it should ask you if you want to cancel/replace with the one you try to install
[08:41] <seb128> or 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:42] <seb128> lissyx, to fix the CI you can probably check the 'snap changes' status before calling the install
[08:42] <lissyx> I am just forcing a refresh
[08:42] <seb128> if there is a firefox auto-refresh entry then sleep & retry until it's fdone
[08:42] <lissyx> like it's not a big deal.
[08:43] <lissyx> I just felt it was awkward and needed an upstream fix, whatever the fix would be
[08:43] <seb128> well, it's like if you try to dpkg -i a deb while a dist-upgrade is ongoing
[08:43] <seb128> dpkg is going to tell you there is a lock in place and bail out
[08:44] <seb128> that's the snap equivalent
[08:44] <seb128> I 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:45] <seb128> snap should probably learn to do something similar
[08:45] <lissyx> I think as long as there's a "snap refresh hold" option, it's different
[08:45] <lissyx> and either snap should gracefully honor it and cancel a pending auto-refresh, or explicitely fail "cannot hold with auto-refresh in progress"
[08:51] <seb128> fair enough
[08:51] <seb128> it should at least warn you at the time of the hold if there is an ongoing refresh
[14:14] <luna-> 23.10 time :)
[16:05] <luna-> https://releases.ubuntu.com/23.10/ubuntu-23.10-desktop-amd64.iso