Bug 893445 - yum -C search whatever return error
yum -C search whatever return error
Status: CLOSED DUPLICATE of bug 903631
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: James Antill
BaseOS QE Security Team
: Regression
Depends On: 903631
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-09 06:00 EST by Patrik Kis
Modified: 2014-01-21 01:25 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 669746
Environment:
Last Closed: 2013-07-19 04:19:49 EDT
Type: ---
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 Patrik Kis 2013-01-09 06:00:56 EST
+++ 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 10:17:34 EDT
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 16:01:19 EDT
 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 04:19:49 EDT
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.