Bug 812789 - rhn-satellite-exporter throws exception when package is not found or malformed in channel
rhn-satellite-exporter throws exception when package is not found or malforme...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Satellite Synchronization (Show other bugs)
541
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Michael Mráka
Ondrej Cienciala
:
Depends On:
Blocks: sat550-lowbug
  Show dependency treegraph
 
Reported: 2012-04-16 04:50 EDT by Martin Minar
Modified: 2014-06-18 03:01 EDT (History)
4 users (show)

See Also:
Fixed In Version: spacewalk-backend-1.7.38-8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-21 05:34:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Minar 2012-04-16 04:50:51 EDT
Description of problem:
In case there was some problem with satellite-sync of channel (or channel contains in some form malformed data) before exporting this channel rhn-satellite-exporter fails with exception.

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

How reproducible:
Always on errata stage

Steps to Reproduce:
1. Sync some channel from errata stage that contains xmlsec1-gnutls-devel-1
.2.9-8.1.i386.rpm (for example rhel-i386-server-5.0.z)
2. Run rhn-satellite-exporter --channel rhel-i386-server-5.0.z --dir /tmp/somedir

  
Actual results:
05:28:34 Gathering channel info...
Appending channels []
05:28:34 Gathering binary RPM info...
05:28:34 Gathering package info...
05:28:34 Gathering errata info...
05:28:34 Gathering kickstart data...
05:28:34 Gathering kickstart files info...


05:28:34 Exporting channel families...
           ____________________
Exporting: #################### - Done!


05:28:35 Exporting arches...
           ____________________
Exporting: #################### - Done!


05:28:35 Exporting arches extra...
           ____________________
Exporting: #################### - Done!


05:28:35 Exporting channel info...
           ____________________
Exporting: Dumping Base Channel Packages
#################### - Done!


05:28:36 Exporting blacklists...
           ____________________
Exporting: #################### - Done!


05:28:36 Exporting short packages...
           ____________________
Exporting: #################### - Done!


05:28:42 Exporting binary RPMs...
           ____________________
Exporting: 05:28:43 
AttributeError caught in dump_rpms.


Expected results:
RPMs from channel are exported.

Additional info:
Exception thrown is:
Exception type exceptions.AttributeError

Exception Handler Information
Traceback (most recent call last):
  File "/usr/share/rhn/satellite_tools/disk_dumper/iss.py", line 847, in dump_rpms
    satellite_path = os.path.join(CFG.MOUNT_POINT, rpm['path'])
  File "/usr/lib64/python2.4/posixpath.py", line 60, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

Local variables by frame
Frame join in /usr/lib64/python2.4/posixpath.py at line 60
	                   a = <type 'str'> /var/satellite
	                path = <type 'str'> /var/satellite
	                   b = <type 'NoneType'> None
	                   p = <type 'tuple'> (None,)

Frame dump_rpms in /usr/share/rhn/satellite_tools/disk_dumper/iss.py at line 886
	                   e = <type 'instance'> 'NoneType' object has no attribute 'startswith'
	         dirs_to_rpm = <type 'str'> /tmp/tmp.yJhyvj1738/rpms/28
	                self = <type 'instance'> <satellite_tools.disk_dumper.iss.Dumper instance at 0x3f32fc8>
	               tbout = <type 'cStringIO.StringO'> <cStringIO.StringO object at 0x2ae980116558>
	                  pb = <type 'instance'> <satellite_tools.progress_bar.ProgressBar instance at 0x3f5e3b0>
	                 rpm = <type 'dict'> {'path': None, 'id': 2528}
	      satellite_path = <type 'str'> /var/satellite/redhat/NULL/ea7/xmlsec1-gnutls-devel/1.2.9-8.1/i386/ea773a0b0047b721da642da259e5c63b/xmlsec1-gnutls-devel-1
.2.9-8.1.i386.rpm
	         path_to_rpm = <type 'str'> /tmp/tmp.yJhyvj1738/rpms/28/rhn-package-2528.rpm

Frame main in /usr/share/rhn/satellite_tools/disk_dumper/iss.py at line 1123
	                dirs = <type 'list'> []
Comment 2 Miroslav Suchý 2012-04-16 09:25:23 EDT
Fixed in spacewalk.git d3f88ad2629c3c36d1fc623643599798cb9b2576
Comment 3 Miroslav Suchý 2012-04-16 09:35:15 EDT
cherrypicked to satellite.git as 80989b0137b7bd5ebdc5e23f7a4a0f73b05c3af0
Comment 4 Martin Minar 2012-04-17 08:48:04 EDT
Ok, the exception was replaced with nicer error message, but main issue remains - with first problem the whole process is stopped.

Wouldn't it be better to simply write error message and continue with next package? Ok, when channel is created with --no-rpms there will be thousands of error lines, but in case of one failed package user will still get some result.
Comment 5 Miroslav Suchý 2012-04-17 10:02:15 EDT
1) this is how we operate for ages - when you could not export something (e.g file is missing on disk) we exit gracefully
2) since exporter write a lot of text to output, it can be easy to miss some warning. So our behaviour is:
  a) we finish - your dump is complete
  b) you have some problem and dump is not complete - exit with error

Nearly complete dump is for nothing.
Comment 10 Clifford Perry 2012-09-21 05:34:51 EDT
This issue is resolved with the release of RHN Satellite 5.5. 

As of September 20th 2012, RHN Satellite 5.5 has been generally available. 

Release Notes and other 5.5 documentation can be found here:

 https://access.redhat.com/knowledge/docs/Red_Hat_Network_Satellite/

The associated Errata for the 5.5 release are:

5.5 Satellite GA Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1296.html

5.5 Upgrade Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1298.html

5.5 RHN Proxy GA Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1297.html

5.5 RHN Tools GA Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1299.html

Regards,
Clifford
- Engineering Manager, Satellite

Note You need to log in before you can comment on or make changes to this bug.