Description of problem: See bug 1655474 comment 7. We need to disable dnf packager in otopi on el7, at least for now.
QE: To reproduce/verify, install python2-dnf and dnf on EL7, then try engine-setup. With older versions, you'll see that it tries to use DNF (and may fail). With a patched version, it will not (and should use yum). Also, with the patched version, add 'PACKAGER/dnfpackagerEnabled=bool:True' to the answerfile, and engine-setup should then try to use dnf. BTW, instead of engine-setup, you can use a debug plugin I added some time ago to otopi, that can be used to cause it to do package management directly. To do this, install also otopi-debug-plugins, and see [1], e.g.: otopi ODEBUG/packagesAction=str:install ODEBUG/packages=str:zziplib,zsh otopi ODEBUG/packagesAction=str:remove ODEBUG/packages=str:zziplib,zsh [1] https://gerrit.ovirt.org/gitweb?p=otopi.git;a=blob;f=README.debug-plugins
FailedQA, it doesn't seem to work on RHEL 7.6 with python2-otopi-1.8.2-1.el7ev. If dnf and python2-dnf are installed, engine-setup always uses DNF (and fails). Trying to disable DNF via 'PACKAGER/dnfpackagerEnabled=bool:False' doesn't have any effect. And vice versa, without dnf & python2-dnf installed, engine-setup always uses YUM, even if 'PACKAGER/dnfpackagerEnabled=bool:True' is used. Verification steps: Answer files used --~-- # cat use-dnf.ans [environment:default] PACKAGER/dnfpackagerEnabled=bool:True # cat dont-use-dnf.ans [environment:default] PACKAGER/dnfpackagerEnabled=bool:False --~-- Running without DNF installed --~-- # rpm -q {python2-,}dnf package python2-dnf is not installed package dnf is not installed # engine-setup [ INFO ] Stage: Initializing [ INFO ] Stage: Environment setup Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf'] Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20190619195824-j6h34h.log Version: otopi-1.8.2 (otopi-1.8.2-1.el7ev) [ INFO ] Stage: Environment packages setup ... [ INFO ] Checking for product updates... [ INFO ] No product updates found ... ## checked in ovirt-engine-setup-.log, it uses YUM # engine-setup --config-append=use-dnf.ans [ INFO ] Stage: Initializing [ INFO ] Stage: Environment setup Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/root/use-dnf.ans'] ... ... same output as above ... --~-- Running with DNF installed --~-- # rpm -q {python2-,}dnf python2-dnf-4.0.9.2-1.el7_6.noarch dnf-4.0.9.2-1.el7_6.noarch # engine-setup [ INFO ] Stage: Initializing [ INFO ] Stage: Environment setup Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf'] Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20190619200342-xukrte.log Version: otopi-1.8.2 (otopi-1.8.2-1.el7ev) ... [ INFO ] Checking for product updates... [ ERROR ] DNF 'Base' object has no attribute '_group_persistor' [ INFO ] DNF Performing DNF transaction rollback [ ERROR ] Failed to execute stage 'Environment customization': 'Base' object has no attribute '_group_persistor' ... ## forcing DNF off # engine-setup --config-append=dont-use-dnf.ans [ INFO ] Stage: Initializing [ INFO ] Stage: Environment setup Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/root/dont-use-dnf.ans'] Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20190619200524-9zbs7b.log Version: otopi-1.8.2 (otopi-1.8.2-1.el7ev) ... [ INFO ] Checking for product updates... [ ERROR ] DNF 'Base' object has no attribute '_group_persistor' [ INFO ] DNF Performing DNF transaction rollback [ ERROR ] Failed to execute stage 'Environment customization': 'Base' object has no attribute '_group_persistor' ... --~--
(In reply to Pavel Novotny from comment #2) > FailedQA, it doesn't seem to work on RHEL 7.6 with > python2-otopi-1.8.2-1.el7ev. > > If dnf and python2-dnf are installed, engine-setup always uses DNF (and > fails). > Trying to disable DNF via 'PACKAGER/dnfpackagerEnabled=bool:False' doesn't > have any effect. Weird. > > And vice versa, without dnf & python2-dnf installed, engine-setup always > uses YUM, > even if 'PACKAGER/dnfpackagerEnabled=bool:True' is used. That's by design. It won't try to install dnf for you, only try using it if already installed. > > Verification steps: > > Answer files used > --~-- > # cat use-dnf.ans > [environment:default] > PACKAGER/dnfpackagerEnabled=bool:True > > # cat dont-use-dnf.ans > [environment:default] > PACKAGER/dnfpackagerEnabled=bool:False > --~-- > > > Running without DNF installed > --~-- > # rpm -q {python2-,}dnf > package python2-dnf is not installed > package dnf is not installed > > # engine-setup > [ INFO ] Stage: Initializing > [ INFO ] Stage: Environment setup > Configuration files: > ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', > '/etc/ovirt-engine-setup.conf.d/10-packaging.conf'] > Log file: > /var/log/ovirt-engine/setup/ovirt-engine-setup-20190619195824-j6h34h.log > Version: otopi-1.8.2 (otopi-1.8.2-1.el7ev) > [ INFO ] Stage: Environment packages setup > ... > [ INFO ] Checking for product updates... > [ INFO ] No product updates found > ... > ## checked in ovirt-engine-setup-.log, it uses YUM > > # engine-setup --config-append=use-dnf.ans > [ INFO ] Stage: Initializing > [ INFO ] Stage: Environment setup > Configuration files: > ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', > '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/root/use-dnf.ans'] > ... > ... same output as above ... > --~-- OK. > > > Running with DNF installed > --~-- > # rpm -q {python2-,}dnf > python2-dnf-4.0.9.2-1.el7_6.noarch > dnf-4.0.9.2-1.el7_6.noarch > > # engine-setup > [ INFO ] Stage: Initializing > [ INFO ] Stage: Environment setup > Configuration files: > ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', > '/etc/ovirt-engine-setup.conf.d/10-packaging.conf'] > Log file: > /var/log/ovirt-engine/setup/ovirt-engine-setup-20190619200342-xukrte.log > Version: otopi-1.8.2 (otopi-1.8.2-1.el7ev) > ... > [ INFO ] Checking for product updates... > [ ERROR ] DNF 'Base' object has no attribute '_group_persistor' > [ INFO ] DNF Performing DNF transaction rollback > [ ERROR ] Failed to execute stage 'Environment customization': 'Base' object > has no attribute '_group_persistor' > ... > > ## forcing DNF off > # engine-setup --config-append=dont-use-dnf.ans > [ INFO ] Stage: Initializing > [ INFO ] Stage: Environment setup > Configuration files: > ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', > '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/root/dont-use-dnf.ans'] > Log file: > /var/log/ovirt-engine/setup/ovirt-engine-setup-20190619200524-9zbs7b.log > Version: otopi-1.8.2 (otopi-1.8.2-1.el7ev) > ... > [ INFO ] Checking for product updates... > [ ERROR ] DNF 'Base' object has no attribute '_group_persistor' > [ INFO ] DNF Performing DNF transaction rollback > [ ERROR ] Failed to execute stage 'Environment customization': 'Base' object > has no attribute '_group_persistor' > ... > --~-- Please attach setup logs of both of these runs. Thanks!
Created attachment 1582577 [details] ovirt-engine-setup logs with DNF installed Sure.
OK, I see. It failed for you in code specific to engine-setup, so the latter part of comment 1 can still be used to verify current bug (on otopi). However, since it's too late for 4.3.4, I am keeping bug on assigned, and would consider patching only otopi also for the specific case of engine-setup, although this seems like it will be a bit ugly.
QE: In addition to comment 1: It's now possible to force otopi to try dnf also by setting env var OTOPI_DNF_ENABLE to 1, e.g.: OTOPI_DNF_ENABLE=1 otopi ODEBUG/packagesAction=str:install ODEBUG/packages=str:zziplib,zsh With tools that do not have answer files, this is your only option. This applies to ovirt-engine-upgrade-check. With tools that do have answer files, you can pass either. If you pass both, otopi env (=answer file) wins over system env. Meaning, if you set in answer file to False, setting '1' in system env should not have any effect. This was needed because some tools (ovirt-engine-upgrade-check and engine-setup) try to use minidnf directly, not (only) via the dnf packager plugin. minidnf is a simple python module, not an otopi plugin, so has no access to otopi env.
Verified in python2-otopi-1.8.3-1.el7ev.noarch Installing dnf and running engine-setup will still use YUM by default. Running `OTOPI_DNF_ENABLE=1 otopi ODEBUG/packagesAction=str:install ODEBUG/packages=str:zziplib,zsh` uses DNF. Running `OTOPI_DNF_ENABLE=1 engine-setup` uses also DNF.
This bugzilla is included in oVirt 4.3.5 release, published on July 30th 2019. Since the problem described in this bug report should be resolved in oVirt 4.3.5 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.