Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1050218

Summary: mock rpm db created in mode 600, YumBaseError not defined
Product: Red Hat Enterprise Linux 7 Reporter: Zenon Panoussis <redhatbugs>
Component: yum-utilsAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED CURRENTRELEASE QA Contact: Karel Srot <ksrot>
Severity: medium Docs Contact:
Priority: low    
Version: 7.0CC: ksrot, packaging-team-maint, vmukhame
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: yum-utils-1.1.31-21.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1097560 (view as bug list) Environment:
Last Closed: 2014-06-13 09:56:16 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 Zenon Panoussis 2014-01-08 21:17:32 UTC
There is a repeat of bug #982043 on el7. The strange thing is that the fix in that bug was yum-utils-1.1.31-19 and that's precisely what is in el7.

result/root.log:

DEBUG util.py:314:  Executing command: /usr/bin/repoquery -c /tmp/tmpvWkMW6 --installed -a --qf '%{nevra} %{buildtime} %{size} %{pkgid} %{yumdb_info.from_repo}' > /var/lib/mock/rhel7-beta1-i686/result/installed_pkgs with env {'LANG': 'en_US.utf8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}
DEBUG util.py:264:  error: cannot open Packages index using db5 - Permission denied (13)
DEBUG util.py:264:  error: cannot open Packages database in /var/lib/mock/rhel7-beta1-i686/root/var/lib/rpm

# ls -l /var/lib/mock/rhel7-beta1-i686/root/var/lib/rpm/
total 24996
-rw------- 1 root mock  1544192 Jan  8 21:55 Basenames
-rw------- 1 root mock     8192 Jan  8 21:55 Conflictname
-rw------- 1 root mock   233472 Jan  8 21:55 Dirnames
-rw------- 1 root mock     8192 Jan  8 21:55 Group
-rw------- 1 root mock    16384 Jan  8 21:55 Installtid
-rw------- 1 root mock    20480 Jan  8 21:55 Name
-rw------- 1 root mock     8192 Jan  8 21:55 Obsoletename
-rw------- 1 root mock 23400448 Jan  8 21:55 Packages
-rw------- 1 root mock   147456 Jan  8 21:55 Providename
-rw------- 1 root mock   139264 Jan  8 21:55 Requirename
-rw------- 1 root mock    32768 Jan  8 21:55 Sha1header
-rw------- 1 root mock    24576 Jan  8 21:55 Sigmd5
-rw------- 1 root mock     8192 Jan  8 21:54 Triggername

# rpm -q yum-utils
yum-utils-1.1.31-19.el7.noarch

Changing the permissions doesn't help; they go back to 600 when mock does chroot init. 

Workaround by initialising the chroot, changing the rpm db permissions manually to 660 and then running mock with --no-clean runs into the next problem:

DEBUG util.py:314:  Executing command: /usr/bin/repoquery -c /tmp/tmpT8pf5x --installed -a --qf '%{nevra} %{buildtime} %{size} %{pkgid} %{yumdb_info.from_repo}' > /var/lib/mock/rhel7-beta1-i686/result/installed_pkgs with env {'LANG': 'en_US.utf8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}
DEBUG util.py:264:  Traceback (most recent call last):
DEBUG util.py:264:    File "/usr/bin/repoquery", line 1547, in <module>
DEBUG util.py:264:      main(sys.argv)
DEBUG util.py:264:    File "/usr/bin/repoquery", line 1415, in main
DEBUG util.py:264:      except YumBaseError, e:
DEBUG util.py:264:  NameError: global name 'YumBaseError' is not defined
DEBUG util.py:354:  Child return code was: 1

Comment 2 Zenon Panoussis 2014-01-08 21:37:13 UTC
The trick with --disable-plugin=package_state still works.

Comment 3 Valentina Mukhamedzhanova 2014-01-10 10:11:59 UTC
The YumBaseError is fixed upstream, ack to the second part of the bug.

Comment 4 Valentina Mukhamedzhanova 2014-01-10 10:25:09 UTC
Please file the first part (mock rpm db created in mode 600) of this bug report as a bug in mock.

Comment 6 Zenon Panoussis 2014-01-10 11:33:31 UTC
(In reply to Valentina Mukhamedzhanova from comment #4)
> Please file the first part (mock rpm db created in mode 600) of this bug
> report as a bug in mock.

That's bug #1051474 now.

Comment 9 Ludek Smid 2014-06-13 09:56:16 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.