Bug 754786

Summary: yum install fails for local repo ending with /
Product: Red Hat Enterprise Linux 6 Reporter: Pierre-YvesChibon <pingou>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1CC: ksrot, pkis, syeghiay, zpavlas
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-22 09:21:59 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 Pierre-YvesChibon 2011-11-17 17:56:37 UTC
Description of problem:
I added a repo file to yum.
The baseurl was:
baseurl=file:///data/repo/RPMS/entreprise/$releasever/r-repo/$basearch/

yum info was returning the information as expected.
yum install was failing.

$ sudo yumdownloader --urls R-ada
...
file:///data/repo/RPMS/entreprise/6Server/r-repo/noarch//R-ada-2.0.2-1.el6.noarch.rpm


The double // was the problem.

To make it working I changed my baseurl to:
baseurl=file:///data/repo/RPMS/entreprise/$releasever/r-repo/$basearch


Version-Release number of selected component (if applicable):
yum-3.2.29-17.el6_1.1.noarch

How reproducible:
always

Steps to Reproduce:
1. Create repo config file with a local baseurl ending with a /
2. yum install <package in the local repo>
  
Actual results:
Error message: [Errno 256] No more mirrors to try. 

Expected results:
Install the said package

Additional info:

Comment 4 Patrik Kis 2012-01-17 13:41:46 UTC
Hi Pierre,
I am not able to reproduce this bug. In my case yum is working as expected.
Seems to me strange that in your setup $basearch is expanded to "noarch". Are you sure this is not a misconfiguration on your system?
Thank you.


[root@rhel61 tmp]# cat /etc/yum.repos.d/testrepo.repo 
[testrepo]
name=testrepo
baseurl=file:///root/testrepo/$releasever/r-repo/$basearch/
gpgcheck=0
enabled=1

[root@rhel61 tmp]# rpm -q yum yum-utils
yum-3.2.29-17.el6_1.1.noarch
yum-utils-1.1.30-6.el6.noarch
[root@rhel61 tmp]# 
[root@rhel61 tmp]# yumdownloader --urls zsh
Loaded plugins: product-id, rhnplugin
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
file:///root/testrepo/6Server/r-repo/x86_64//zsh-4.3.10-4.1.el6.x86_64.rpm
[root@rhel61 tmp]# 
[root@rhel61 tmp]# yum -y install zsh
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating Red Hat repositories.
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package zsh.x86_64 0:4.3.10-4.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                       Arch                                             Version                                                   Repository                                          Size
===================================================================================================================================================================================================================
Installing:
 zsh                                           x86_64                                           4.3.10-4.1.el6                                            testrepo                                           2.1 M

Transaction Summary
===================================================================================================================================================================================================================
Install       1 Package(s)

Total download size: 2.1 M
Installed size: 4.8 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : zsh-4.3.10-4.1.el6.x86_64                                                                                                                                                                       1/1 
duration: 53(ms)
Installed products updated.

Installed:
  zsh.x86_64 0:4.3.10-4.1.el6                                                                                                                                                                                      

Complete!
[root@rhel61 tmp]# yumdownloader zsh
Loaded plugins: product-id, rhnplugin
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
zsh-4.3.10-4.1.el6.x86_64.rpm                                                                                                                                                               | 2.1 MB     00:00     
[root@rhel61 tmp]# ls zsh*.rpm
zsh-4.3.10-4.1.el6.x86_64.rpm

Comment 5 Pierre-YvesChibon 2012-01-17 14:01:53 UTC
I reported the bug on the demand of Seth after he helped me to debug it.

When I had this problem, I actually had two repo added, one $basearch, one 'noarch' (the idea was to not duplicate the noarch package nor use symlink, since I changed that setup).

I will try to replicate it again.

Comment 6 Karel Srot 2012-02-01 10:21:50 UTC
Hi, 
any update on this?

Seth, 
we are not able to reproduce this bug (see #c4). Can you provide more details about the set up?
Thank you.

Comment 7 Karel Srot 2012-02-14 09:20:49 UTC
Seth?

Comment 8 seth vidal 2012-02-14 14:15:27 UTC
I do not recall the context of this, now.
I thought this was fixed with a normpath() in the code.

Comment 9 Zdeněk Pavlas 2012-02-15 15:21:51 UTC
I too can't reproduce it.

The BASE + RELATIVE url/filepath concatenation is done in urlgrabber's mirror group module, and it DOES indeed prevent duping the slash.  The code dates to one of the initial commits back in 2004.

Comment 10 Pierre-YvesChibon 2012-02-22 08:53:17 UTC
ok I can't reproduce it anymore. Back then I had a weird configuration with a repo for arch and one for noarch, but I don't see how it would be related.

I just did some tests here and with or without the tailing slash I can install the rpm.

hm I don't seem to be able to close the bug directly, can you do it?


Thanks and sorry that it took so long.