Bug 726935

Summary: yum gets confused when it sees an HTTP repository with a port in its URL
Product: [Fedora] Fedora Reporter: M J <login>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 14CC: ffesti, james.antill, maxamillion, pmatilai, tla, zpavlas
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-16 15:51:02 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 M J 2011-07-31 06:46:14 UTC
Description of problem:
I created a local repository on my hard drive on a "master server node" in order to perform a network install. I test this repository locally by using the yum client to download packages into a file-based file system mounted as a loop device and formatted with ext3. 

The repository is set up so that repodata is in a different tree than the actual directory containing raw packages (/Everything/). So the layout is as follows:
/clus/yumrepo/repodata/<yum repository dirs and files>
/clus/fedora-packages/<all packages>

The httpd server is properly configured so that it can see the entire /clus root. One can browse to the repository and view it.

Version-Release number of selected component (if applicable):
yum-3.2.28.fc14
yum-utils-1.1.28-1.fc14

How reproducible:
You need to set up a local yum repository by mirroring or by using another tool such as yumdownloader (see the yum-utils package). 

Steps to Reproduce:
1. Create the repository with createrepo. Assume below that this repository
  is configured with the id 'repo-local' so that one can pull from it using
  yum --enablerepo=repo-local.
  *  Make sure that you give createrepo the parameter --base-url with a url that
   uses a non-standard port.
  *  When you use createrepo, make sure that you create the repository metadata in a different directory than that which stores the packages. This is important.
2. Set your httpd server to the non-standard port (8018) and point it at the repository.
3. Set up an artificial file system by creating a file and mounting as a drive using a loop device:
  dd if=/dev/zero of=diskimage.img oflag=direct bs=1M count=0 seek=4096
  mkfs.ext3 diskimage.img
4. Mount the pretend file system
  mkdir /mnt/pretendfs
  mount diskimage.img /mnt/pretendfs
5. Use the yum client to "install" a file system onto the pretend file system:
  yum --disablerepo=* --enablerepo=repo-local --install-root=/mnt/pretendfs install filesystem basesystem

Actual results:
You should see: 
---- SNIP ----
Loaded plugins: auto-update-debuginfo, downloadonly, langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package basesystem.noarch 0:10.0-3 set to be installed
--> Processing Dependency: setup for package: basesystem-10.0-3.noarch
---> Package filesystem.x86_64 0:2.4.35-1.fc14 set to be installed
--> Running transaction check
---> Package setup.noarch 0:2.8.28-1.fc14 set to be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================
 Package                              Arch                             Version                                   Repository                               Size
===============================================================================================================================================================
Installing:
 basesystem                           noarch                           10.0-3                                    cluster-local                           4.2 k
 filesystem                           x86_64                           2.4.35-1.fc14                             cluster-local                           1.0 M
Installing for dependencies:
 setup                                noarch                           2.8.28-1.fc14                             cluster-local                           152 k

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

Total download size: 1.1 M
Installed size: 660 k
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 1.1 M
http://node1.joyanet/clus/fedora-packages/basesystem-10.0-3.noarch.rpm: [Errno 14] PYCURL ERROR 7 - ""
Trying other mirror.
http://node1.joyanet/clus/fedora-packages/filesystem-2.4.35-1.fc14.x86_64.rpm: [Errno 14] PYCURL ERROR 7 - ""
Trying other mirror.
http://node1.joyanet/clus/fedora-packages/setup-2.8.28-1.fc14.noarch.rpm: [Errno 14] PYCURL ERROR 7 - ""
Trying other mirror.


Error Downloading Packages:
  filesystem-2.4.35-1.fc14.x86_64: failed to retrieve filesystem-2.4.35-1.fc14.x86_64.rpm from cluster-local
error was [Errno 14] PYCURL ERROR 7 - ""
  basesystem-10.0-3.noarch: failed to retrieve basesystem-10.0-3.noarch.rpm from cluster-local
error was [Errno 14] PYCURL ERROR 7 - ""
  setup-2.8.28-1.fc14.noarch: failed to retrieve setup-2.8.28-1.fc14.noarch.rpm from cluster-local
error was [Errno 14] PYCURL ERROR 7 - ""
---- SNIP ---


Expected results:
What you want to see is the following:
---- SNIP ----
Loaded plugins: auto-update-debuginfo, downloadonly, langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package basesystem.noarch 0:10.0-3 set to be installed
--> Processing Dependency: setup for package: basesystem-10.0-3.noarch
---> Package filesystem.x86_64 0:2.4.35-1.fc14 set to be installed
--> Running transaction check
---> Package setup.noarch 0:2.8.28-1.fc14 set to be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================
 Package                              Arch                             Version                                   Repository                               Size
===============================================================================================================================================================
Installing:
 basesystem                           noarch                           10.0-3                                    cluster-local                           4.2 k
 filesystem                           x86_64                           2.4.35-1.fc14                             cluster-local                           1.0 M
Installing for dependencies:
 setup                                noarch                           2.8.28-1.fc14                             cluster-local                           152 k

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

Total download size: 1.1 M
Installed size: 660 k
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 1.1 M
(1/3): basesystem-10.0-3.noarch.rpm                                                                                                     | 4.2 kB     00:00     
(2/3): filesystem-2.4.35-1.fc14.x86_64.rpm                                                                                              | 1.0 MB     00:00     
(3/3): setup-2.8.28-1.fc14.noarch.rpm                                                                                                   | 152 kB     00:00     
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                           24 MB/s | 1.1 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : setup-2.8.28-1.fc14.noarch                                                                                                              1/3 
  Installing     : filesystem-2.4.35-1.fc14.x86_64                                                                                                         2/3 
  Installing     : basesystem-10.0-3.noarch                                                                                                                3/3 

Installed:
  basesystem.noarch 0:10.0-3                                                 filesystem.x86_64 0:2.4.35-1.fc14                                                

Dependency Installed:
  setup.noarch 0:2.8.28-1.fc14                                                                                                                                 

Complete!
---- SNIP ----


Additional info:
Mirroring is a fast way to create a yum repository. However, createrepo will accept a directory with any number of .rpm files in it. Once the directory is created, the rest is straightforward. Check that the repository is working correctly in your browser using the non-standard port after you have started the httpd server.

It looks like yum grabs the repository url from /etc/yum.repos.d and fetches file lists, but then uses the file lists to locate a separate url (here, the separate directory containing all the packages.) Somewhere along the way, it might be turning the URL into a programmatic form and dropping the port number along the way.

Comment 1 seth vidal 2011-08-01 16:29:45 UTC
baseurl from the .repo is honored for finding the repository repodata. However, if the repository metadata includes a baseurl for the pkg then yum will use that.

Please include your .repo file definition and your primary.xml.gz file

Comment 2 Fedora End Of Life 2012-08-16 15:51:05 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping