"./nuxeoctl mp-remove..." installs bundles?
Here's some kind of user story related to bundle management. It started by installing by mistake Nuxeo Drive 1.1.2, then realizing that that version targets Nuxeo 5.7.3 and not the 5.6 platform I'm using.
From this point I've been unable to restore my platform to a usable state. At some point Nuxeo seems to have installed Nuxeo DM 5.7.3 by itself, and now the bundles management seems broken:
$> ./nuxeo mp-list
hotfix started nuxeo-5.6.0-HF00 (id: nuxeo-5.6.0-HF00-1.0.0) .... hotfix started nuxeo-5.6.0-HF23 (id: nuxeo-5.6.0-HF23-1.0.0) addon downloaded nuxeo-dm (id: nuxeo-dm-5.6.0) addon started nuxeo-dm (id: nuxeo-dm-5.7.3) addon downloaded nuxeo-drive (id: nuxeo-drive-1.0.4) addon started nuxeo-drive (id: nuxeo-drive-1.1.2) addon started nuxeo-social-collaboration (id: nuxeo-social-collaboration-5.6.0) addon downloaded nuxeo-social-collaboration (id: nuxeo-social-collaboration-5.7.3) addon downloaded nuxeo-template-rendering (id: nuxeo-template-rendering-5.6.0) addon downloaded nuxeo-template-rendering (id: nuxeo-template-rendering-6.1.2)
$ ./nuxeoctl mp-remove nuxeo-dm-5.7.3 nuxeo-drive-1.1.2 nuxeo-social-collaboration-5.7.3 nuxeo-template-rendering-6.1.2
Package nuxeo-dm-5.7.3 is not available on platform version cap-5.6. Do you want to relax the constraint (yes/no)? [no] yes
First unexpected behavior: why is this asking me to relax the constraint? all I want is to remove bundles I already have. Anyway:
Relax restriction to target platform cap-5.6 because of package nuxeo-dm-5.7.3 Dependency resolution: Installation order: nuxeo-dm-5.7.1/nuxeo-drive-1.1.1 Packages to upgrade: nuxeo-dm:5.7.3, nuxeo-drive:1.1.2 Do you want to continue (yes/no)? [yes]
All I wanted was to remove bundles, yet it forces me to install Nuxeo DM 5.7.1 with… Nuxeo Drive for Nuxeo 5.7.2, weird.
If I confirm, and try to remove these afterwards:
$> ./nuxeoctl mp-remove nuxeo-dm-5.7.1 nuxeo-drive-1.1.1
Package nuxeo-dm-5.7.1 is not available on platform version cap-5.6. Do you want to relax the constraint (yes/no)? [no] yes Relax restriction to target platform cap-5.6 because of package nuxeo-dm-5.7.1 Dependency resolution: Installation order: nuxeo-dm-5.7.3/nuxeo-drive-1.1.2/nuxeo-social-collaboration-5.7.3 Packages to upgrade: nuxeo-dm:5.7.1, nuxeo-drive:1.1.1, nuxeo-social-collaboration:5.6.0
He wants me to install Nuxeo DM 5.7.3. Infinite loop!
I can fix this for a while by using ./nuxeoctl mp-install nuxeo-dm-5.6.0 nuxeo-drive-1.0.4 instead. But even after all the right bundles are restored, I can't remove the 5.7.1 ones without upgrading everything to 5.7.3.
Troubles are back if I want to install something else:
$> ./nuxeoctl mp-install nuxeo-web-mobile-dm
Dependency resolution: Installation order: nuxeo-drive-1.1.1/nuxeo-template-rendering-6.0.1/nuxeo-web-mobile-dm-1.2.0 Packages to upgrade: nuxeo-template-rendering:5.6.0, nuxeo-drive:1.0.4 Uninstalling nuxeo-drive-1.0.4 Installing nuxeo-drive-1.1.1 Installing nuxeo-template-rendering-6.0.1 Installing nuxeo-web-mobile-dm-1.2.0
I never asked for updating Nuxeo Drive.
$> ./nuxeoctl mp-remove nuxeo-web-mobile-dm
Dependency resolution: Uninstallation order: nuxeo-web-mobile-dm-1.2.0 Uninstalling nuxeo-web-mobile-dm-1.2.0 Removing nuxeo-web-mobile-dm-1.2.0
$> ./nuxeoctl mp-list
hotfix started nuxeo-5.6.0-HF00 (id: nuxeo-5.6.0-HF00-1.0.0) ... hotfix started nuxeo-5.6.0-HF23 (id: nuxeo-5.6.0-HF23-1.0.0) addon downloaded ekium (id: ekium-2.4.0-SNAPSHOT) addon downloaded nuxeo-dm (id: nuxeo-dm-5.6.0) addon started nuxeo-dm (id: nuxeo-dm-5.7.1) addon downloaded nuxeo-drive (id: nuxeo-drive-1.0.4) addon started nuxeo-drive (id: nuxeo-drive-1.1.1) addon started nuxeo-social-collaboration (id: nuxeo-social-collaboration-5.6.0) addon downloaded nuxeo-template-rendering (id: nuxeo-template-rendering-5.6.0) addon started nuxeo-template-rendering (id: nuxeo-template-rendering-6.0.1)
Nuxeo DM has actually upgraded to 5.7.1 without even telling me. I guess I'll have to hack into registry.xml or simple start from a fresh distrib.
Conclusion, the package management should probably be made a bit dumber (at least during deletion), it seems to try to hard at dealing with dependencies, leading to broken situations like this one.
Interesting feedback, thank you. Here is some information:
- Using a package ID (nuxeo-dm-5.7.3) does not behave the same as with a package name (nuxeo-dm). For instance, with
mp-uninstall, it means a downgrade or upgrade, not a removal.
- The target platform relax is effectively annoying, and maybe useless, when removing things. It's a possible improvement to replace it with a simple warning when the platform already contains unadapted packages. => NXP-13100
- The automatic upgrade comes from the dependency solver which provides an “ideal” solution to the request, including upgrades. It's a wanted improvement to change that point: NXBT-652.
- Another useful and related improvement is the ability to lock/pin on a given version: NXP-13051.
Note you should:
- Preferably use package names, not ID. Unless you explicitly want something specific.
- Avoid use of
--nodeps, unless you know what you want and what you do. Therefore, avoid installing unadapted packages.
mp-resetmay help to workaround with all this, especially when upgrading the server (see NXP-8014).
- Do not hack the registry. In your case, it's still easy to cleanup everything and come back to the initial server status; hacking the registry would only definitely break your server management.
Feel free to ask for improvements, new commands or options and to report your use cases. We need administrators' feedback on such tools as the Launcher/nuxeoctl.
Thanks for the information, it explains some of the unexpected behavior.
In my opinion, here are two things that would make the nuxeoctl tool much more comfortable for admins:
Change the mp-remove and mp-uninstall behavior, to make them do nothing more than uninstalling/deleting packages. I guess that if a user wants to downgrade a package, he will intuitively try the command "./nuxeo mp-install package-VERSION" instead (which works too, I think?). I'm not sure anyone would use an "mp-remove" command and expect to install an older version of the same module, it just feels counter-intuitive.
Cheap but useful: replace the "Installation order/Packages to upgrade" lines with something that more explicitly why additional packages are installed, e.g.
$> ./nuxeoctl mp-install nuxeo-web-mobile-dm
- nuxeo-drive-1.1.1 (current version: 1.0.4)
- nuxeo-template-rendering-6.0.1 (not installed)
Installation order: nuxeo-drive-1.1.1/nuxeo-template-rendering-6.0.1/nuxeo-web-mobile-dm-1.2.0
I just discovered the –nodeps option, which can help a lot in those sort of situations.