Bug 698795 - yum doesn't react well to rpm's "doesn't run when in rootsquashed NFS dir."
Summary: yum doesn't react well to rpm's "doesn't run when in rootsquashed NFS dir."
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 15
Hardware: i686
OS: Linux
high
urgent
Target Milestone: ---
Assignee: Nick Jacek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 709283 714241 723729 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-21 19:51 UTC by Jussi Eloranta
Modified: 2014-01-21 23:18 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-21 14:15:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
A proposed patch to rpm chroot code. (3.77 KB, patch)
2011-07-22 09:14 UTC, Zdeněk Pavlas
no flags Details | Diff

Description Jussi Eloranta 2011-04-21 19:51:06 UTC
Description of problem:

yum install switch\* should install switchdesk utility (the new gnome is terrible btw!!!). Yum claims to have installed it but if I look at this with rpm -q it is not there. If I try to reinstall it with yum, it claims that it is already installed. I was only able to install it after using yumdownloader and rpm -i. Also, if I remove these packages with yum, it claims that they were removed but again rpm -q shows that they were not. So something is obviously broken in yum.

Version-Release number of selected component (if applicable):

yum-langpacks-0.2.2-1.fc15.noarch
yum-3.2.29-4.fc15.noarch
PackageKit-yum-plugin-0.6.13-1.fc15.i686
yum-metadata-parser-1.1.4-4.fc15.i686
yum-presto-0.6.2-3.fc15.noarch
yum-utils-1.1.30-2.fc15.noarch
PackageKit-yum-0.6.13-1.fc15.i686

Comment 1 Jussi Eloranta 2011-04-21 20:11:37 UTC
An update. If I do this in /tmp (or any other root read/write -able directory), it works fine. However, I was in /home, which is nfs mounted (and root squashed, i.e. no read/write for root). In this case I got the following output from yum install ...:


Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 160 k
(1/2): switchdesk-4.0.9-8.fc15.2.noarch.rpm              |  24 kB     00:00     
(2/2): switchdesk-gui-4.0.9-8.fc15.2.noarch.rpm          | 136 kB     00:00     
--------------------------------------------------------------------------------
Total                                           154 kB/s | 160 kB     00:01     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
switchdesk-4.0.9-8.fc15.2.noarch was supposed to be installed but is not!
switchdesk-gui-4.0.9-8.fc15.2.noarch was supposed to be installed but is not!

Installed:
  switchdesk.noarch 0:4.0.9-8.fc15.2   switchdesk-gui.noarch 0:4.0.9-8.fc15.2  

Complete!

The same thing happens if I try to remove any packages with yum in non-read/writeable dir.

Comment 2 Panu Matilainen 2011-06-06 06:32:24 UTC
*** Bug 709283 has been marked as a duplicate of this bug. ***

Comment 3 Panu Matilainen 2011-06-06 07:08:57 UTC
This is related to a change in how rpm handles chroot, see bug 672576.

I can easily reproduce the "supposed to be <...> but is not" issue with yum, rpm itself gives the "expected" result in this situation:

[root@localhost lorg]# rpm -e --test telnet
error: Unable to open current directory: Permission denied
[root@localhost lorg]#

That yum gives such a confusing output is due to two separate issues with yum:
- Yum's test-transaction return code checking doesn't handle the "creative" return codes from ts.run() correctly
- Yum's transaction logging redirects the rpm log to a file, silencing this kind of early transaction error message(s) from librpm

I'll have a look, expect patches on yum-devel...

Comment 4 James Antill 2011-06-17 18:50:48 UTC
 Patches from Panu would still be fine/good ... otherwise anyone else can look at it ... it might already be much better with upstream yum (should now show an error for the packages), but I don't expect that we tell the user what the problem is, yet (rpm can't open .).

 Bonus points for any patch that can work out this is going to happen and does a chdir to / :) :)

Comment 5 James Antill 2011-06-20 14:25:13 UTC
*** Bug 714241 has been marked as a duplicate of this bug. ***

Comment 6 Frank Ch. Eigler 2011-07-21 13:29:58 UTC
*** Bug 723729 has been marked as a duplicate of this bug. ***

Comment 7 James Antill 2011-07-21 13:44:07 UTC
Note that the latest rawhide yum _should_ spot this ... Frank, what version were you using?

Comment 8 Frank Ch. Eigler 2011-07-21 13:57:44 UTC
James, yum-3.4.3-4.fc16.noarch emits this now:

   No read/write access in current directory, moving to /

and works.  OTOH, rpm-4.9.0-7.fc16.x86_64 says:

% cd $HOME
% sudo rpm -e gnuchess
error: Unable to open current directory: Permission denied

Comment 9 James Antill 2011-07-21 14:15:11 UTC
 Yeh, cool ... Nick added the workaround to yum.

Comment 10 Frank Ch. Eigler 2011-07-21 14:29:13 UTC
James, what about the rpm -e EPERM bit?

Comment 11 James Antill 2011-07-21 14:45:18 UTC
 That's an rpm thing, and the best we have atm. is:

https://bugzilla.redhat.com/show_bug.cgi?id=672576#c7

...you can open an rpm bug, but without a working patch I'm guessing it's going to be closed.
 Also ... don't call rpm -e or rpm -i directly :).

Comment 12 Zdeněk Pavlas 2011-07-22 09:14:37 UTC
Created attachment 514644 [details]
A proposed patch to rpm chroot code.


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