Red Hat Bugzilla – Bug 808516
generation of yum repo fails if channel_checksum is null
Last modified: 2012-11-01 12:20:33 EDT
+++ This bug was initially created as a clone of Bug #629878 +++
Description of problem:
I have dump which comes from bug 563501. This dump can be imported in sat530 and channel repodata was regenerated without any problem.
In sat540 I cannot regenerate repodata for channel in dump due to missing checksum.
Version-Release number of selected component (if applicable):
latest sat540.nightly and SW1.2nightly
Steps to Reproduce:
1. use dump from attachment of this bug, or from bug 563501#c12 -- its the same
2. tar xf dump-bz-563501.tar -C /tmp
3. satellite-sync -m /tmp/dump1 -c test-i386-1
1. there isn't checksum_type in db:
SQL> select checksum_type_id from rhnChannel where label = 'test-i386-1';
there is sha1 checksum for this dump. I can regenerate repodata for this channel.
--- Additional comment from firstname.lastname@example.org on 2010-09-03 03:46:38 EDT ---
my script for regenerating all repodata in sat:
[root@tyan-gt24-07 ~]# cat a
import server.repomd.repository as repository
import server.rhnChannel as rhnChannel
import common.rhnConfig as rhnConfig
import server.rhnSQL as rhnSQL
channels = rhnChannel.list_channels('%')
for channel in channels:
print "Channel: %s" % channel['name']
repo = repository.get_repository(rhnChannel.channel_info(channel['label']))
[root@tyan-gt24-07 ~]# python a
Channel: Name test-i386-1
Traceback (most recent call last):
File "a", line 23, in <module>
File "/usr/share/rhn/server/repomd/repository.py", line 327, in get_repomd_file
File "/usr/share/rhn/server/repomd/repository.py", line 149, in get_primary_view
return self.get_cache_view(self.primary_prefix, view.PrimaryView)
File "/usr/share/rhn/server/repomd/repository.py", line 136, in get_cache_view
viewobj = view_class(self.channel, ret)
File "/usr/share/rhn/server/repomd/repository.py", line 191, in __get_channel
self._channel = channel_mapper.get_channel(self.channel_id)
File "/usr/share/rhn/server/repomd/mapper.py", line 114, in get_channel
channel.label = details
TypeError: 'NoneType' object is unsubscriptable
this script works well in sat530.
workaround for sat540 is: go to webUI, look at channel, and save page with sha1 checksum.
--- Additional comment from email@example.com on 2012-03-30 09:39:37 EDT ---
This is more an issue with Satellite 5.4 maintaining backward-compatibility at the export/import layer than it is a problem with checksum regeneration.
In Satellite 5.3 (and previous) all channels were checksummed with sha1. We apparently didn't bother including that in the export xml because it was always true.
In Satellite 5.4 we have multiple options for checksum type, including "None" or null (for channels that will be consumed by clients that do not use yum, for example RHEL 4). In Satellite 5.4 exports we include the checksum type, including explicitly stating that the type is none if that is what is selected for this channel:
The problem here is that if the channel-dump does not include a checksum type we assume a default value of null, which breaks compatibility with pre-5.4 versions of Satellite. Channels with no checksum type do not get yum repodata generated for them (yum requires a checksum type).
What we should do instead is assume that if the channel-dump has *no* value for rhn-channel-checksum-type that we are coming from a pre-5.4 Satellite and the checksum type should default to sha1. Only if the channel-dump explicitly says it should be null should we set the value to null.
Committed to Spacewalk master: 0fb9604f7b7c01113e23718977d8f79afedcc112
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18