Bug 1470189

Summary: Mock crashes because there is no dnf
Product: [Fedora] Fedora EPEL Reporter: Jaroslav Škarvada <jskarvad>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: jdisnard, jskarvad, mebrown, msimacek, msuchy, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.4.3-1.fc26 mock-1.4.3-1.fc25 mock-1.4.3-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-10 16:54:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Škarvada 2017-07-12 13:49:23 UTC
Description of problem:
On RHEL-7 mock is unusable in default configuration.

Version-Release number of selected component (if applicable):
mock-1.4.2-1.el7

How reproducible:
Always

Steps to Reproduce:
1. mock -r fedora-25-x86_64 shell

Actual results:
INFO: mock.py version 1.4.2 starting (python version = 2.7.5)...
ERROR: Command /usr/bin/dnf is not available. Either install package containing this command
or run mock with --yum or --dnf to overwrite config value. However this may
lead to different dependency solving!
Traceback (most recent call last):
  File "/usr/libexec/mock/mock", line 934, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/libexec/mock/mock", line 703, in main
    buildroot = Buildroot(config_opts, uidManager, state, plugins, bootstrap_buildroot)
  File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.7/site-packages/mockbuild/buildroot.py", line 62, in __init__
    self.pkg_manager = package_manager(config, self, plugins, bootstrap_buildroot)
  File "/usr/lib/python2.7/site-packages/mockbuild/package_manager.py", line 43, in package_manager
    return Dnf(config_opts, chroot, plugins, bootstrap_buildroot)
  File "/usr/lib/python2.7/site-packages/mockbuild/package_manager.py", line 288, in __init__
    self._check_command()
  File "/usr/lib/python2.7/site-packages/mockbuild/package_manager.py", line 171, in _check_command
    lead to different dependency solving!""".format(self.command))
Exception: Command /usr/bin/dnf is not available. Either install package containing this command
or run mock with --yum or --dnf to overwrite config value. However this may
lead to different dependency solving!

Expected results:
No error

Additional info:
The 'mock --yum -r fedora-25-x86_64 shell' works.

I also played with the "config_opts['use_bootstrap_container'] = True", but I wasn't able to get it working.

I think the mock for EPEL-7 should came with working configuration that works out of the box and it shouldn't traceback by default.

Comment 1 Miroslav Suchý 2017-07-13 14:46:13 UTC
This should work, and it works for most users.

Can you please paste here output of:
  python -c 'import distro; print distro.linux_distribution(full_distribution_name=False)[0:2];'

Comment 2 Jaroslav Škarvada 2017-07-13 15:23:46 UTC
(u'rhel', u'7.0')

Actually it's fully upgraded 7.3, just /etc/system-release*, /etc/redhat-release, and /etc/os-release weren't updated for some reason which is unknown to me.

Comment 3 Jaroslav Škarvada 2017-07-13 15:25:34 UTC
(In reply to Jaroslav Škarvada from comment #2)
> (u'rhel', u'7.0')
> 
> Actually it's fully upgraded 7.3, just /etc/system-release*,
> /etc/redhat-release, and /etc/os-release weren't updated for some reason
> which is unknown to me.

Installed Packages
redhat-release-workstation.x86_64                                        7.0-1.el7                                        @anaconda/7.0
Available Packages
redhat-release-server.x86_64                                             7.3-7.el7                                        rhel-7       

Ah, it's probably because it has been initially installed as a workstation by Anaconda and later upgraded from server repo, but yum should be still correctly auto-detected.

Comment 4 Miroslav Suchý 2017-07-13 17:17:21 UTC
> (u'rhel', u'7.0')

Weird. This used to be 'redhat'. I added 'rhel' to the set. Commit e8625f5.
Thank you for the report.

Comment 5 Fedora Update System 2017-08-06 23:46:13 UTC
mock-1.4.3-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-53f9c9cb51

Comment 6 Fedora Update System 2017-08-06 23:46:44 UTC
mock-1.4.3-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-204acb9aa4

Comment 7 Fedora Update System 2017-08-06 23:47:16 UTC
mock-1.4.3-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4ee5b66a4c

Comment 8 Fedora Update System 2017-08-07 21:48:52 UTC
mock-1.4.3-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-53f9c9cb51

Comment 9 Fedora Update System 2017-08-07 22:25:26 UTC
mock-1.4.3-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4ee5b66a4c

Comment 10 Fedora Update System 2017-08-08 01:23:20 UTC
mock-1.4.3-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-204acb9aa4

Comment 11 Fedora Update System 2017-08-10 16:54:51 UTC
mock-1.4.3-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2017-08-22 12:48:23 UTC
mock-1.4.3-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2017-08-23 10:28:58 UTC
mock-1.4.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.