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 893445 - yum -C search whatever return error
Summary: yum -C search whatever return error
Keywords:
Status: CLOSED DUPLICATE of bug 903631
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On: 903631
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-09 11:00 UTC by Patrik Kis
Modified: 2014-01-21 06:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 669746
Environment:
Last Closed: 2013-07-19 08:19:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Patrik Kis 2013-01-09 11:00:56 UTC
+++ This bug was initially created as a clone of Bug #669746 +++

Description of problem:
yum -C search whatever as a non-root does not works
This works on RHEL-6 so this can be considered as regression.

Version-Release number of selected component (if applicable):
yum-3.4.3-46.el7

How reproducible:
always

Steps to Reproduce:
# useradd testusr
#
# yum search zsh
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.

Error Message:
	Please run rhn_register as root on this client
Error Class Code: 9
Error Class Info: Invalid System Credentials.
Explanation: 
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.

=========================================== N/S Matched: zsh ===========================================
zsh-debuginfo.i686 : Debug information for package zsh
zsh-debuginfo.x86_64 : Debug information for package zsh
zsh-html.i686 : Zsh shell manual in html format
zsh-html.x86_64 : Zsh shell manual in html format
zsh.i686 : Powerful interactive shell
zsh.x86_64 : Powerful interactive shell

  Name and summary matches only, use "search all" for everything.
#
# su - testusr
$ yum -C search zsh
Loaded plugins: product-id, rhnplugin, security, subscription-manager
*Note* Red Hat Network repositories are not listed below. You must run this command as root to access RHN repositories.
Error: Cannot access repository dir /var/tmp/yum-testusr-GXZdje/x86_64/6.92Server/qa-tools
$ echo $?
1
$
  
Actual results:
yum return error
yum makecache as user root does not help

Expected results:
yum return the search result like in RHEL-6

Additional info:gg
In RHEL6 this works:
# useradd testusr
# 
# yum search zsh
Loaded plugins: downloadonly, fastestmirror, product-id, security, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
Loading mirror speeds from cached hostfile
=========================================== N/S Matched: zsh ===========================================
python-twisted-core-zsh.x86_64 : Tab completion for Zsh and Twisted Core
zsh-debuginfo.x86_64 : Debug information for package zsh
zsh-html.x86_64 : Zsh shell manual in html format
zsh.x86_64 : A powerful interactive shell

  Name and summary matches only, use "search all" for everything.
# 
# su - testusr
$ yum -C search zsh
Loaded plugins: downloadonly, fastestmirror, product-id, security, subscription-manager, tmprepo
Not root, certificate-based repositories not updated
=========================================== N/S Matched: zsh ===========================================
python-twisted-core-zsh.x86_64 : Tab completion for Zsh and Twisted Core
zsh-debuginfo.x86_64 : Debug information for package zsh
zsh-html.x86_64 : Zsh shell manual in html format
zsh.x86_64 : A powerful interactive shell

  Name and summary matches only, use "search all" for everything.
$

Comment 2 Zdeněk Pavlas 2013-06-13 14:17:34 UTC
The problem is that:

1) since commit 0f03409 (Tue Dec 13 15:43:30 2011) users always have their own cachedir (even when -C is in use)

2) The -C option instructs Yum NOT to attempt any modification of the cachedir.

As a result, preloading from root to user cachedir does not work when user runs "yum -C .."  I wrote a patch to fix (some cases of) this, but it's not upstream.  It's also questionable whether it's a bug or not.  See this thread:

http://lists.baseurl.org/pipermail/yum-devel/2012-June/009298.html

Comment 3 James Antill 2013-06-18 20:01:19 UTC
 Yeh, not much has changed since that thread. In theory we can change .cache = 1 to mean "no network activity" and declare all past API usage of cachedir=<system>, cache=1 as broken/bad ... but we should really have done that sooner.
 From what I can see all current yum-utils scripts "behave" and wouldn't trigger this problem.


 Maybe putting the access() check from the thread:

http://lists.baseurl.org/pipermail/yum-devel/2013-June/010175.html

...into a property (cached) and using that to say "can't modify" instead of cache=1 would be quick and have no downsides (push it and se^W run ;).

Comment 4 Jan Zeleny 2013-07-19 08:19:49 UTC
Reviewed the dependency on #903631 and assessed it to be a duplicate.

*** This bug has been marked as a duplicate of bug 903631 ***


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