Bug 1108138

Summary: Channel exporter tooling needs to handle missing repodata gracefully
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: TransitionsAssignee: Tomas Lestach <tlestach>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: NightlyCC: bbuckingham
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-utils-2.0.2-14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:19:05 UTC Type: Bug
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: 1125243    

Description Lukas Pramuk 2014-06-11 13:08:36 UTC
Description of problem:
Channel exporter tooling when tries to handle repository with missing repodata produces a traceback. The tooling needs to handle missing repodata gracefully.

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


How reproducible:
100%

Steps to Reproduce:

# spacewalk-export

INFO: Processing channels...
Processing organization: ClusterStorageQE
Processing organization: GSS
...
 * channel: epel_rhel6_x86-64 with: 8614 packages
Traceback (most recent call last):
  File "/usr/bin/spacewalk-export-channels", line 297, in <module>
    export_packages(options)
  File "/usr/bin/spacewalk-export-channels", line 120, in export_packages
    repo_packages[repo['id']] = list_repo_packages(repo['label'], repo['source_url'])
  File "/usr/bin/spacewalk-export-channels", line 236, in list_repo_packages
    packages = map(lambda p:p.getNEVRA(), plugin.list_packages(repo_plugin, []))
  File "/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/repo_plugins/yum_src.py", line 159, in list_packages
    self.sack.populate(self.repo, 'metadata', None, 0)
  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 165, in populate
    if self._check_db_version(repo, mydbtype):
  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 223, in _check_db_version
    return repo._check_db_version(mdtype)
  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 1256, in _check_db_version
    repoXML = self.repoXML
  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 1455, in <lambda>
    repoXML = property(fget=lambda self: self._getRepoXML(),
  File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 1451, in _getRepoXML
    raise Errors.RepoError, msg
yum.Errors.RepoError: Cannot retrieve repository metadata (repomd.xml) for repository: epel_repo_rhel6_x86-64. Please verify its path and try again
INFO: Processing system-groups...
INFO: Processing activation-keys...
INFO: Processing repositories...
INFO: Processing users...
INFO: Export-file created at /root/spacewalk-export-dir/spacewalk_export.tar.gz

Actual results:
traceback

Expected results:
warning about missing repodata and proceeding with what it can

Additional info:
repo['label'] = 'epel_repo_rhel6_x86-64'
repo['source_url'] = 'http://mirrors.servercentral.net/fedora/epel/6/x86_64/' - 404 Not Found

Comment 1 RHEL Program Management 2014-06-11 13:09:45 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Tomas Lestach 2014-06-11 14:43:18 UTC
spacewalk.git: b34c64a08f95c6ba48131bb57c43d08ea078308f

Fixed in upstream spacewalk-utils-2.2.20-1

Comment 6 Lukas Pramuk 2014-08-25 12:26:35 UTC
VERIFIED. spacewalk-utils-2.0.2-15.el6sat

1. @SAT5: create repo with non-existent url 
2. export repositories:
# spacewalk-export --entities=repositories
INFO: Processing repositories...
INFO: Export-file created at /root/spacewalk-export-dir/spacewalk_export.tar.gz

Comment 7 Bryan Kearney 2014-09-11 12:19:05 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.