"all" mode snap upgrade from 2.7 to 2.8 fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Committed
|
Critical
|
Alberto Donato | ||
snapd |
Invalid
|
Undecided
|
Unassigned |
Bug Description
This can be reproduced easily by installing maas 2.7 in all mode and trying to ugprade to 2.8
snap install maas --channel=2.7
maas init --mode all
root@f2:~# snap list maas
Name Version Rev Tracking Publisher Notes
maas 2.7.3-8290-
root@f2:~# snap refresh maas --channel=2.8
error: cannot perform the following tasks:
- Run post-refresh hook of "maas" snap if present (run hook "post-refresh": Can't refresh snap in 'all' mode while disabled.)
root@f2:~# snap refresh maas --channel=2.8
error: cannot perform the following tasks:
- Run post-refresh hook of "maas" snap if present (run hook "post-refresh": mv: cannot move '/var/snap/
Related branches
- Adam Collard: Approve
- MAAS Lander: Needs Fixing
-
Diff: 14 lines (+3/-0)1 file modifiedsnap/hooks/install (+3/-0)
- Adam Collard: Approve
- MAAS Lander: Approve
-
Diff: 19 lines (+1/-7)1 file modifiedsnap/hooks/install (+1/-7)
Changed in maas: | |
assignee: | nobody → Alberto Donato (ack) |
Changed in maas: | |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
The issue is due to this check in maas' post-refresh hook:
if snapctl services "$service" | grep -q disabled; then
echo "Can't refresh snap in 'all' mode while disabled." >&2
exit 1
During a refresh, the service is now reported as "disabled", which shouldn't be the case, as it should only be inactive during the upgrade:
+ snapctl services maas.supervisor
Service Startup Current Notes
maas.supervisor disabled inactive -
MAAS checks the service status as if maas is updated while the service is disabled, postgres won't be running, so it's wouldn't be possible to run migrations.
It seems like something might have changed in snapd that's now reporting the service as disabled.