The spacewalk-repo-sync command fails with error 'yum.Errors.RepoError: Cannot retrieve repository metadata (repomd.xml) for repository' after adding http proxy entries to /etc/rhn/rhn.conf
Environment
- Red Hat Network(RHN) Satellite 5.4, 5.5, 5.6
Issue
- The spacewalk-repo-sync command fails with following error after adding http proxy entries to /etc/rhn/rhn.conf
[root@]# spacewalk-repo-sync --channel epel-5-x86_64 --type yum
Traceback (most recent call last):
File "/usr/bin/spacewalk-repo-sync", line 72, in ?
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 103, in main
self.import_packages(plugin, url)
File "/usr/share/rhn/satellite_tools/reposync.py", line 135, in import_packages
packages = plug.list_packages()
File "/usr/share/rhn/satellite_tools/repo_plugins/yum_src.py", line 75, in list_packages
sack.populate(repo, 'metadata', None, 0)
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 168, in populate
if self._check_db_version(repo, mydbtype):
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 226, in _check_db_version
return repo._check_db_version(mdtype)
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1226, in _check_db_version
repoXML = self.repoXML
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1399, in <lambda>
repoXML = property(fget=lambda self: self._getRepoXML(),
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1395, in _getRepoXML
raise Errors.RepoError, msg
yum.Errors.RepoError: Cannot retrieve repository metadata (repomd.xml) for repository: epel-5-x86_64. Please verify its path and try again
- Another example of the problem:
# spacewalk-repo-sync --channel puppetlabs-products --url=http://yum.puppetlabs.com/el/6.4/products/x86_64/
Repo URL: http://yum.puppetlabs.com/el/6.4/products/x86_64/
ERROR: Cannot retrieve repository metadata (repomd.xml) for repository: puppetlabs-products. Please verify its path and try again
Sync completed.
Total time: 0:00:00
Resolution
Remove the http:// prefix from the server.satellite.http_proxy entry in /etc/rhn/rhn.conf.
For example, change the following entry from:
server.satellite.http_proxy = http://proxy.example.com:3128
... to ...
server.satellite.http_proxy = proxy.example.com:3128
Note that satellite-sync isn't affected by this and works regardless of whether the http:// prefix exists or not.
Root Cause
spacewalk-repo-sync fails if the server.satellite.http_proxy entry in /etc/rhn/rhn.conf has a http:// (or https://) prefix.
SBR
Product(s)
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.