Bug 745090

Summary: "yum remove" does not honor "skip_if_unavailable" option
Product: [Fedora] Fedora Reporter: Hedayat Vatankhah <hedayatv>
Component: yumAssignee: Fedora Packaging Toolset Team <packaging-team>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: ffesti, james.antill, maxamillion, pmatilai, tla, zpavlas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-02 08:59:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Hedayat Vatankhah 2011-10-11 11:26:37 UTC
Description of problem:
I have a repository with skip_if_unavailable=1 option set. Usually the repository is not available (it is a removable media). Now, I want to remove a package from my system, using yum remove. Since the repository is not available, yum prints and (unrelated) error message and exits (it asks me to try --skip-broken). 
I wonder if yum remove should check for new metadata at all, but even in that case it should honor skip_if_unavailable=1 option.

Version-Release number of selected component (if applicable):
3.2.29-9.fc15

How reproducible:
100%

Steps to Reproduce:
1. create a .repo file for an imaginary repo with skip_if_unavailable option set
2. try to remove a simple package using "yum remove"

  
Actual results:
yum exits with an error message saying that it is unable to fetch repomd.xml for the repository, and suggests to try --skip-broken

Expected results:
Remove the package successfully.

Comment 1 Zdeněk Pavlas 2011-10-18 12:21:43 UTC
Hi!

> Since the repository is not available, yum prints and (unrelated) error message and exits (it asks me to try --skip-broken). 

skip_if_unavailable=1 option does not prevent yum from displaying error messages during repo setup, it should just ignore such errors.  I think this works well (at least for removable media).

Maybe yum exits due to unrelated dependency issue?  Can you post the yum output, ideally with -d9?  Thanks.

Comment 2 Hedayat Vatankhah 2011-10-18 14:27:42 UTC
I found the same problem with "yum grouplist" command.
No, yum doesn't exit with any dependency issue and if I provide the repository it'll remove the package without any problems. Also I installed a new package and tried removing it and faced the same problem. 
This is the output with -d9 for 'yum grouplist' (the 'yum remove' is also present at the bottom):

===============================================================================[root@hedayat-lap hedayat]# yum -d9 grouplist --disableplugin=local,langpacks,yum-fast-downloader
Not loading "blacklist" plugin, as it is disabled
Loading "presto" plugin
Loading "refresh-packagekit" plugin
Not loading "whiteout" plugin, as it is disabled
Running "config" handler for "presto" plugin
Config time: 0.036
Yum Version: 3.2.29
COMMAND: yum -d9 grouplist --disableplugin=local,langpacks,yum-fast-downloader 
Installroot: /
Setting up Group Process
Getting group metadata
file:///media/Parsidora%2015%20x86_64%20DVD/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/Parsidora 15 x86_64 DVD/repodata/repomd.xml
Trying other mirror.
file:///media/Fedora%2015%20x86_64%20DVD/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/Fedora 15 x86_64 DVD/repodata/repomd.xml
Trying other mirror.
file:///media/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrom/repodata/repomd.xml
Trying other mirror.
file:///mnt/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///mnt/cdrom/repodata/repomd.xml
Trying other mirror.
file:///mnt/repodata/repomd.xml: [Errno 14] Could not open/read file:///mnt/repodata/repomd.xml
Trying other mirror.
Getting group metadata
file:///media/Parsidora%2015%20x86_64%20DVD/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/Parsidora 15 x86_64 DVD/repodata/repomd.xml
Trying other mirror.
file:///media/Fedora%2015%20x86_64%20DVD/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/Fedora 15 x86_64 DVD/repodata/repomd.xml
Trying other mirror.
file:///media/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrom/repodata/repomd.xml
Trying other mirror.
file:///mnt/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///mnt/cdrom/repodata/repomd.xml
Trying other mirror.
file:///mnt/repodata/repomd.xml: [Errno 14] Could not open/read file:///mnt/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: parsidora-dvd. Please verify its path and try again
===============================================================================

And 'yum remove' output:
===============================================================================
[root@hedayat-lap hedayat]# yum -d9 --disableplugin=local,langpacks,yum-fast-downloader remove texlive-luapersian
Not loading "blacklist" plugin, as it is disabled
Loading "presto" plugin
Loading "refresh-packagekit" plugin
Not loading "whiteout" plugin, as it is disabled
Running "config" handler for "presto" plugin
Config time: 0.037
Yum Version: 3.2.29
COMMAND: yum -d9 --disableplugin=local,langpacks,yum-fast-downloader remove texlive-luapersian 
Installroot: /
Ext Commands:

   texlive-luapersian
Reading Local RPMDB
rpmdb time: 0.000
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package texlive-luapersian.noarch 0:2010-5.0.1.svn23576.fc16 will be erased
Checking deps for texlive-luapersian.noarch 0:2010-5.0.1.svn23576.fc16 - e
--> Finished Dependency Resolution
Dependency Process ending
file:///media/Parsidora%2015%20x86_64%20DVD/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/Parsidora 15 x86_64 DVD/repodata/repomd.xml
Trying other mirror.
file:///media/Fedora%2015%20x86_64%20DVD/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/Fedora 15 x86_64 DVD/repodata/repomd.xml
Trying other mirror.
file:///media/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrom/repodata/repomd.xml
Trying other mirror.
file:///mnt/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///mnt/cdrom/repodata/repomd.xml
Trying other mirror.
file:///mnt/repodata/repomd.xml: [Errno 14] Could not open/read file:///mnt/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: parsidora-dvd. Please verify its path and try again
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
===============================================================================

Comment 3 James Antill 2011-10-18 15:26:10 UTC
 I can't reproduce any of this with upstream, but I don't remember fixing either bug since F15.

1. yum remove doesn't access any repos. at all.

2. skip_if_unavailable works when I run group list.

 You could try the rawhide rebuild repo:

http://repos.fedorapeople.org/repos/james/yum-rawhide/fedora-yum-rawhide.repo

...and see if that fixes it (very close to upstream).

Comment 4 Hedayat Vatankhah 2011-10-18 18:07:41 UTC
I confirm that the bug is fixed in rawhide version of yum for both grouplist and remove. :)

Comment 5 Fedora Admin XMLRPC Client 2012-04-27 15:40:39 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.