MAAS snap upgrade fails at post-refresh hook

I’m trying to upgrade from 2.7 to 2.8. Unfortunately it is failing because the migrations take too long and exceed the timeout for the post-refresh hook of snapd.
Is there a way to fix this?
Thanks

snap refresh --channel=2.8 maas
error: cannot perform the following tasks:
- Run post-refresh hook of "maas" snap if present (run hook "post-refresh":
-----
Operations to perform:
  Apply all migrations: auth, contenttypes, maasserver, metadataserver, piston3, sessions, sites
Running migrations:
  Applying maasserver.0203_interface_node_name_duplicates_delete... OK
  Applying maasserver.0204_interface_node_name_unique_together... OK
  Applying maasserver.0205_pod_nodes... OK
  Applying maasserver.0206_remove_node_token... OK
  Applying maasserver.0207_notification_dismissable... OK
  Applying maasserver.0208_no_power_query_events...
<exceeded maximum runtime of 10m0s>
-----)

When re-attempting the upgrade, it also fails with the following error:

snap refresh --channel=2.8 maas
error: cannot perform the following tasks:
- Run post-refresh hook of "maas" snap if present (run hook "post-refresh": mv: cannot move '/var/snap/maas/13516/var/lib/maas' to '/var/snap/maas/common/maas': Directory not empty)

I’m not sure how to proceed. Is it safe to delete /var/snap/maas/common/maas?

hmm. i’m not sure how to tell you either. one way might be not to delete /var/snap/maas/common/maas, but to snap remove -- purge it and reinstall 2.8 in its place. i hesitate to recommend because i don’t know what you’d lose. let me bounce this back to the team and see if they have recommendations.

Here’s what worked for me in the end.

snap remove maas
snap install --channel=3.0 maas
maas init region+rack --database-uri ...

The initialization picked up the database migrations and completed them.
I had a backup of the database but did not have to use it.
Also I did not bother to try with 2.8. Jumped directly to 3.0.

1 Like

nice work. glad you made the jump.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.