Bug 1470189 - Mock crashes because there is no dnf
Mock crashes because there is no dnf
Status: CLOSED ERRATA
Product: Fedora EPEL
Classification: Fedora
Component: mock (Show other bugs)
epel7
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Suchý
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-12 09:49 EDT by Jaroslav Škarvada
Modified: 2017-08-23 06:28 EDT (History)
7 users (show)

See Also:
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 12:54:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jaroslav Škarvada 2017-07-12 09:49:23 EDT
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 10:46:13 EDT
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 11:23:46 EDT
(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 11:25:34 EDT
(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 13:17:21 EDT
> (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 19:46:13 EDT
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 19:46:44 EDT
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 19:47:16 EDT
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 17:48:52 EDT
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 18:25:26 EDT
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-07 21:23:20 EDT
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 12:54:51 EDT
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 08:48:23 EDT
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 06:28:58 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.