This is something we are hitting on CI, ubuntu 22.04
https://treeherder.mozilla.org/logviewer?job_id=431990807&repo=try&lineNumber=80-83
> [task 2023-10-10T15:05:03.960Z] /home/ubuntu/tasks/task_169694991363220/fetches
> [task 2023-10-10T15:05:03.960Z] + ARTIFACT_DIR=/home/ubuntu/tasks/task_169694991363220/builds/worker/artifacts/
> [task 2023-10-10T15:05:03.960Z] + mkdir -p /home/ubuntu/tasks/task_169694991363220/builds/worker/artifacts/
> [task 2023-10-10T15:05:03.965Z] + sudo snap refresh --hold=24h firefox
> [task 2023-10-10T15:05:08.788Z] General refreshes of "firefox" held until 2023-10-11T15:05:06Z
> [task 2023-10-10T15:05:08.798Z] + sudo snap install --name firefox --dangerous ./firefox.snap
> [task 2023-10-10T15:05:16.963Z] error: snap "firefox" has "auto-refresh" change in progress
snapd is:
> [task 2023-10-11T13:21:09.331Z] + snap info snapd
> [task 2023-10-11T13:21:10.223Z] name: snapd
> [task 2023-10-11T13:21:10.223Z] summary: Daemon and tooling that enable snap packages
> [task 2023-10-11T13:21:10.223Z] publisher: Canonical**
> [task 2023-10-11T13:21:10.223Z] store-url: https://snapcraft.io/snapd
> [task 2023-10-11T13:21:10.223Z] contact: https://github.com/snapcore/snapd/issues
> [task 2023-10-11T13:21:10.223Z] license: GPL-3.0
> [task 2023-10-11T13:21:10.223Z] description: |
> [task 2023-10-11T13:21:10.223Z] Install, configure, refresh and remove snap packages. Snaps are
> [task 2023-10-11T13:21:10.223Z] 'universal' packages that work across many different Linux systems,
> [task 2023-10-11T13:21:10.223Z] enabling secure distribution of the latest apps and utilities for
> [task 2023-10-11T13:21:10.223Z] cloud, servers, desktops and the internet of things.
> [task 2023-10-11T13:21:10.223Z]
> [task 2023-10-11T13:21:10.223Z] Start with 'snap list' to see installed snaps.
> [task 2023-10-11T13:21:10.223Z] type: snapd
> [task 2023-10-11T13:21:10.223Z] snap-id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4
> [task 2023-10-11T13:21:10.223Z] tracking: latest/stable
> [task 2023-10-11T13:21:10.223Z] refresh-date: 21 days ago, at 00:35 UTC
> [task 2023-10-11T13:21:10.223Z] channels:
> [task 2023-10-11T13:21:10.223Z] latest/stable: 2.60.4 2023-10-10 (20290) 42MB -
> [task 2023-10-11T13:21:10.223Z] latest/candidate: 2.60.4 2023-10-03 (20290) 42MB -
> [task 2023-10-11T13:21:10.223Z] latest/beta: 2.60.4 2023-09-15 (20290) 42MB -
> [task 2023-10-11T13:21:10.223Z] latest/edge: 2.60.4+git1413.g0e64f05 2023-10-10 (20479) 42MB -
> [task 2023-10-11T13:21:10.223Z] installed: 2.60.3 (20092) 42MB snapd
I think the title probably doesn't reflect what's going on, my guess is that the auto-refresh was already started in background by the time the hold command was issued
Unsure what would be the best outcome there. Having the install call cancel the ongoing refresh and install the specified revision after instead if returning an error? Or waiting for the ongoing transaction to be done to then install instead of returning?