Comment 3 for bug 1938321

Revision history for this message
Paweł Stołowski (stolowski) wrote :

Reproduced with "snap install maas --channel=2.7; maas init --mode all; snap refresh maas --channel=2.8", but as far as I can tell it's been working like this for 2-3 years if not more, so I'm confused it didn't fail before (unless the "$(maas_snap_mode)" = "all" case in maas post-refresh hook was not hit before?)

For the record, the failing change on refresh looks like this (hook error output omitted):

Done today at 11:33 UTC today at 11:33 UTC Ensure prerequisites for "maas" are available
Undone today at 11:33 UTC today at 11:33 UTC Download snap "maas" (13516) from channel "2.8"
Done today at 11:33 UTC today at 11:33 UTC Fetch and check assertions for snap "maas" (13516)
Undone today at 11:33 UTC today at 11:33 UTC Mount snap "maas" (13516)
Undone today at 11:33 UTC today at 11:33 UTC Run pre-refresh hook of "maas" snap if present
Undone today at 11:33 UTC today at 11:33 UTC Stop snap "maas" services
Undone today at 11:33 UTC today at 11:33 UTC Remove aliases for snap "maas"
Undone today at 11:33 UTC today at 11:33 UTC Make current revision for snap "maas" unavailable
Undone today at 11:33 UTC today at 11:33 UTC Copy snap "maas" data
Undone today at 11:33 UTC today at 11:33 UTC Setup snap "maas" (13516) security profiles
Undone today at 11:33 UTC today at 11:33 UTC Make snap "maas" (13516) available to the system
Undone today at 11:33 UTC today at 11:33 UTC Automatically connect eligible plugs and slots of snap "maas"
Undone today at 11:33 UTC today at 11:33 UTC Set automatic aliases for snap "maas"
Undone today at 11:33 UTC today at 11:33 UTC Setup snap "maas" aliases
Error today at 11:33 UTC today at 11:33 UTC Run post-refresh hook of "maas" snap if present
Hold today at 11:33 UTC today at 11:33 UTC Start snap "maas" (13516) services
Hold today at 11:33 UTC today at 11:33 UTC Clean up "maas" (13516) install
Hold today at 11:33 UTC today at 11:33 UTC Run configure hook of "maas" snap if present
Hold today at 11:33 UTC today at 11:33 UTC Run health check of "maas" snap
Done today at 11:33 UTC today at 11:33 UTC Handling re-refresh of "maas" as needed

The critical moment is on "Make current revision for snap "maas" unavailable" task: we unlink the old snap revision and remove wrappers for all services (they are stopped earlier with 'Stop snap "maas" services'), and call systemctl daemon-reload. We then link the new version of the snap (Make snap "maas" (13516) available...) which also re-creates systemd units for the services, but nothing gets started yet; so for post-refresh hook the service appears inactive and disabled. The services would get started and enabled (unless explicitly disabled by the user) with 'Start snap "maas" (13516) services'.

Does this explanation make sense?