Bug 1908602

Summary: dnf packager is broken on CentOS Stream
Product: [oVirt] otopi Reporter: Yedidyah Bar David <didi>
Component: Plugins.packagersAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Guilherme Santos <gdeolive>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: masterCC: bugs, gdeolive, steven
Target Milestone: ovirt-4.4.5Flags: pm-rhel: ovirt-4.4+
sbonazzo: devel_ack+
gdeolive: testing_ack+
Target Release: 1.9.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: otopi-1.9.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-22 10:22:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1915806    

Description Yedidyah Bar David 2020-12-17 06:54:02 UTC
Description of problem:

It fails with (e.g. from [1][2]):

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt-engine-common/distro-rpm/packages.py", line 322, in _setup
    osetuputil.getPackageManager(self.logger)
  File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/util.py", line 265, in getPackageManager
    'No supported package manager found in your system'
RuntimeError: No supported package manager found in your system

This is due to code in otopi that disables dnf if the OS verion is not at least >= '8.0'. CentOS Stream reports '8'. With a patch it to require >= '8' [3], it fails with [4][5]:

2020-12-16 21:48:33,353+0000 ERROR otopi.plugins.otopi.packagers.dnfpackager dnfpackager.error:84 DNF Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
2020-12-16 21:48:33,355+0000 DEBUG otopi.context context._executeMethod:145 method exception
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 574, in load
    ret = self._repo.load()
  File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 397, in load
    return _repo.Repo_load(self)
libdnf._error.Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/otopi/plugins/otopi/packagers/dnfpackager.py", line 205, in _setup
    with self._minidnf.transaction():
  File "/usr/lib/python3.6/site-packages/otopi/minidnf.py", line 291, in __enter__
    self._managed.beginTransaction()
  File "/usr/lib/python3.6/site-packages/otopi/minidnf.py", line 562, in beginTransaction
    self._base = self._createBase()
  File "/usr/lib/python3.6/site-packages/otopi/minidnf.py", line 351, in _createBase
    base.fill_sack()
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 392, in fill_sack
    self._add_repo_to_sack(r)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 137, in _add_repo_to_sack
    repo.load()
  File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 581, in load
    raise dnf.exceptions.RepoError(str(e))
dnf.exceptions.RepoError: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

[1] https://jenkins.ovirt.org/job/ovirt-system-tests_he-basic-suite-master/1853/

[2] https://jenkins.ovirt.org/job/ovirt-system-tests_he-basic-suite-master/1853/artifact/exported-artifacts/test_logs/he-basic-suite-master/post-he_deploy/lago-he-basic-suite-master-host-0/_var_log/ovirt-hosted-engine-setup/engine-logs-2020-12-17T02%3A18%3A09Z/ovirt-engine/setup/ovirt-engine-setup-20201217031711-6m07d0.log

[3] https://gerrit.ovirt.org/c/otopi/+/112682

[4] https://jenkins.ovirt.org/job/otopi_standard-check-patch/340/

[5] https://jenkins.ovirt.org/job/otopi_standard-check-patch/340/artifact/check-patch.el8.x86_64/logs/otopi-packager-stream-20201216214830-kay532.log

Comment 1 Sandro Bonazzola 2020-12-22 09:34:03 UTC
*** Bug 1909965 has been marked as a duplicate of this bug. ***

Comment 3 Sandro Bonazzola 2021-03-22 12:57:23 UTC
This bugzilla is included in oVirt 4.4.5 release, published on March 18th 2021.

Since the problem described in this bug report should be resolved in oVirt 4.4.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.