Nextcloud update between multiple major versions

Just want to share some notes on the problems we may find in this use case.

Had a test machine with:

  • nextcloud-10.0.2-1.ns7.noarch
  • nethserver-nextcloud-1.0.4-1.ns7.noarch

Updates brought Nextcloud 12, which was unable to login and showing an exception:

Jun  3 08:50:07 test2 esmith::event[8561]: Action: /etc/e-smith/events/nethserver-nextcloud-update/S00initialize-default-databases SUCCESS [0.195041]
Jun  3 08:50:07 test2 esmith::event[8561]: expanding /etc/httpd/conf.d/default-virtualhost.inc
Jun  3 08:50:07 test2 esmith::event[8561]: expanding /etc/httpd/conf.d/nethserver.conf
Jun  3 08:50:07 test2 esmith::event[8561]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.142583]
Jun  3 08:50:08 test2 esmith::event[8561]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Jun  3 08:50:08 test2 esmith::event[8561]: You may use your browser or the occ upgrade command to do the upgrade
Jun  3 08:50:08 test2 esmith::event[8561]: Maintenance mode enabled
Jun  3 08:50:08 test2 esmith::event[8561]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Jun  3 08:50:08 test2 esmith::event[8561]: You may use your browser or the occ upgrade command to do the upgrade
Jun  3 08:50:08 test2 esmith::event[8561]: Set log level to debug
Jun  3 08:50:08 test2 esmith::event[8561]: Exception: Updates between multiple major versions and downgrades are unsupported.
Jun  3 08:50:08 test2 esmith::event[8561]: Update failed
Jun  3 08:50:08 test2 esmith::event[8561]: Maintenance mode is kept active
Jun  3 08:50:08 test2 esmith::event[8561]: Reset log level
Jun  3 08:50:08 test2 esmith::event[8561]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Jun  3 08:50:08 test2 esmith::event[8561]: You may use your browser or the occ upgrade command to do the upgrade
Jun  3 08:50:08 test2 esmith::event[8561]: Maintenance mode disabled
Jun  3 08:50:08 test2 esmith::event[8561]: Action: /etc/e-smith/events/nethserver-nextcloud-update/S20nethserver-nextcloud-conf SUCCESS [0.879938]
Jun  3 08:50:08 test2 su: (to apache) root on none
Jun  3 08:50:09 test2 esmith::event[8561]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Jun  3 08:50:09 test2 esmith::event[8561]: You may use your browser or the occ upgrade command to do the upgrade
Jun  3 08:50:09 test2 esmith::event[8561]: System config value trusted_domains => 0 set to string localhost
Jun  3 08:50:09 test2 su: (to apache) root on none
Jun  3 08:50:09 test2 esmith::event[8561]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Jun  3 08:50:09 test2 esmith::event[8561]: You may use your browser or the occ upgrade command to do the upgrade
Jun  3 08:50:09 test2 esmith::event[8561]: System config value trusted_domains => 1 set to string test2.local.neth.eu
Jun  3 08:50:09 test2 su: (to apache) root on none
Jun  3 08:50:09 test2 esmith::event[8561]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Jun  3 08:50:09 test2 esmith::event[8561]: You may use your browser or the occ upgrade command to do the upgrade
Jun  3 08:50:09 test2 esmith::event[8561]: System config value trusted_domains => 2 set to string 192.168.2.12
Jun  3 08:50:09 test2 esmith::event[8561]: Action: /etc/e-smith/events/nethserver-nextcloud-update/S30nethserver-nextcloud-occ-conf SUCCESS [0.858034]

To get back to square one, restored the virtual machine to a previous snapshot, and followed this procedure on the command line to get Nextcloud 12 up and running:

[root@test2 ~]# rpm -qa *nextcloud
nextcloud-10.0.2-1.ns7.noarch
nethserver-nextcloud-1.0.4-1.ns7.noarch
[root@test2 ~]# yum makecache fast
[root@test2 ~]# yum --showduplicates list *nextcloud
Available Packages
nethserver-nextcloud.noarch                       1.0.4-1.ns7                          nethserver-base   
nethserver-nextcloud.noarch                       1.1.0-1.ns7                          nethserver-updates
nethserver-nextcloud.noarch                       1.1.1-1.ns7                          nethserver-updates
nethserver-nextcloud.noarch                       1.1.2-1.ns7                          nethserver-updates
nethserver-nextcloud.noarch                       1.1.3-1.ns7                          nethserver-updates
nethserver-nextcloud.noarch                       1.1.4-1.ns7                          nethserver-updates
nextcloud.noarch                                  10.0.2-1.ns7                         nethserver-base   
nextcloud.noarch                                  10.0.4-2.el7                         epel              
nextcloud.noarch                                  11.0.2-1.4.ns7                       nethserver-updates
nextcloud.noarch                                  11.0.3-2.ns7                         nethserver-updates
nextcloud.noarch                                  12.0.0-1.ns7                         nethserver-updates
[root@test2 ~]# yum update nethserver-nextcloud-1.1.0-1.ns7 nextcloud-11.0.2-1.4.ns7
[root@test2 ~]# yum update
[root@test2 ~]# rpm -qa *nextcloud
nextcloud-12.0.0-1.ns7.noarch
nethserver-nextcloud-1.1.4-1.ns7.noarch

NOTE: the update to Nextcloud 12 presented some warnings on the Admin page.

1 Like

Thank you @dnutan for pointing this out!

Releasing major versions while keeping the same package name (nextcloud, nethserver-nextcloud) forces to keep the pace with upstream releases. 10, 11 and 12 were released quickly, so many 10 installs now needs to upgrade to 11 before being upgraded to 12.

If we keep the current package release cycle your workaround is the only possible solution.

The alternative is being more conservative by releasing separate pacakges: nextcloud12, nextcloud13… like upstream did for samba, samba3, samba4 packages. This solution is the safest, however it makes difficult to upgrade!

What can we do? :thinking:

This is the most conservative solution but really hard for admins.

Administrators are notified both from NethServer and Nextcloud web interface when a new version is available.
I think we only need to always release the last intermediate release before a major upgraded.
As far I can remember we always did it for Nextcloud.

Of course, we can’t support major upgrades if upstream doesn’t.

I’d like to continue with current approach, maybe we can add a note in the manual.

@dnutan what do you think?

How this would work for modules in the software center? …with an additional Upgrade tab or just from the command line?

I like conservative approach if it prevents production timedowns, but this may piss off admins. Moreover, the devteam may have to maintain more minor versions for each major release. Not sure it’s the right move.

Is there something like conditional updates (or requires) for rpm packages?

  • check installed version (if any)
  • compare version number (installed vs. update)
  • if more than one major version jump, require intermediate package(s)

I think we can make it work even from the web interface, but the admin will still need to manually install each release.

YUM can’t handle intermediate package. If you execute the update, it will always install the latest package.

In the end, I think the actual behavior is the most simple one.