Bug 577668

Summary: reposync crashes with "YumRepo Error: All mirror URLs are not using ftp, http[s] or file."
Product: [Community] Spacewalk Reporter: Erik Logtenberg <erik>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: low    
Version: 0.9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 613991 (view as bug list) Environment:
Last Closed: 2010-05-10 14:50:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 582354, 613991    

Description Erik Logtenberg 2010-03-28 19:00:57 UTC
Description of problem:

I just created a fresh Fedora 12 x86_64 mirror channel in Spacewalk (latest nightly build), and checked "Sync Repo". No packages are downloaded, so I checked the logs. They were almost empty:

# cat fedora-12-x86_64-2010.03.28-20:46:00.log
--label is obsoleted

Sync started: Sun Mar 28 20:46:00 2010
['/usr/bin/spacewalk-repo-sync', '--channel', 'fedora-12-x86_64', '--url', 'ftp://alviss.et.tudelft.nl/pub/fedora/linux/releases/12/Everything/x86_64/os/', '--type', 'yum', '--label', 'fedora-12-x86_64', '--quiet']

That's it. Now I started spacewalk-repo-sync manually with exactly these options except the --quiet option, and got the following results:

# /usr/bin/spacewalk-repo-sync --channel fedora-12-x86_64 --url ftp://alviss.et.tudelft.nl/pub/fedora/linux/releases/12/Everything/x86_64/os/ --type yum --label fedora-12-x86_64
--label is obsoleted
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. drwxr-xr-x    2 500      500          4096 Nov 11 12:08 repodata/
removing mirrorlist with no valid mirrors: /var/cache/rhn/reposync/fedora-12-x86_64-67351398/mirrorlist.txt
Traceback (most recent call last):
  File "/usr/bin/spacewalk-repo-sync", line 72, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/spacewalk-repo-sync", line 66, in main
    sync.main()
  File "/usr/share/rhn/satellite_tools/reposync.py", line 105, in main
    self.import_packages(self.plugin.list_packages())
  File "/usr/share/rhn/satellite_tools/repo_plugins/yum_src.py", line 53, in list_packages
    repo.baseurlSetup()
  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 596, in baseurlSetup
    self._baseurlSetup()
  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 647, in _baseurlSetup
    self.check()
  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 423, in check
    'Cannot find a valid baseurl for repo: %s' % self.id
yum.Errors.RepoError: Cannot find a valid baseurl for repo: fedora-12-x86_64-67351398

Apparently something is wrong, but I'm not quite sure what. The URL is an official Fedora 12 mirror, and it works fine. The repodata directory is there, is accessible and seems to contain exactly what it should contain.

Version-Release number of selected component (if applicable):
Latest nightly build of Spacewalk 0.9 on a fully up-to-date Fedora 12 x86_64 install. No other packages have been installed other than Oracle, both Spacewalk and Oracle are installed exactly as prescribed in the Install-Howto.
No configuration is done yet, other than "spacewalk-setup --disconnected" and the creation of an admin account and this one channel.

I entered the following settings for my channel:

Channel Name: Fedora 12 x86_64
Channel Label: fedora-12-x86_64
Parent Channel: none
Parent Channel Architecture: x86_64
Yum Repository Checksum Type: sha265
Channel Summary: Fedora 12 x86_64 mirror

Repository URL: ftp://alviss.et.tudelft.nl/pub/fedora/linux/releases/12/Everything/x86_64/os/
Label: fedora-12-x86_64
Sync Repo: x (check)

How reproducible:
100%

Steps to Reproduce:
1. Install fresh Fedora 12
2. Install Oracle and Spacewalk according to Install-Howto
3. Create channel with abovementioned settings
4. Observe crash
  
Actual results:
Abovementioned error.

Expected results:
Synchronized channel.

Comment 1 Michael Mráka 2010-03-30 11:11:30 UTC
The issue was introduced by code for automatic mirror / single repo recognition.

It has been fixed in 
commit 27e0b1c315c16ca0aad4da051292f3306fa0b400
    url can be mirrorlist or single repo
commit c50b6582778a98126c8ea02686da1f9a758f9693
    Revert "added heuristic to recognize whether url is mirrorlist or plain repo"  
    Need better implementation which works also for ftp: and file:
    This reverts commit 6bc72ee3923f7eab68376dc62c030901d4db8675.

Comment 2 Erik Logtenberg 2010-03-30 11:36:48 UTC
Thanks! Micheal, is this fix also available as a new nightly build (or will it be)?

Comment 3 Michael Mráka 2010-03-30 19:13:29 UTC
Hi Erik,

yes, packages spacewalk-backend*-0.9.17-1 has been built and pushed to nightly repo.

Comment 4 Michael Mráka 2010-05-10 14:50:26 UTC
This bug has been fixed in Spacewalk 1.0.