Created attachment 503710 [details] RHN-Package-Manager issue - Logs Description of problem: rhn-package-manager fails to upload metadata to Satellite 541 RHEL6. The problem is not presented on Satellite installed on RHEL5 but relevant for both RHN-Proxy on RHEL5 and RHEL6. Version-Release number of selected component (if applicable): Satellite 541 RHEL6 How reproducible: Always Steps to Reproduce: 1.Provision RHEL6/5 guest/host 2.Install RHN-Proxy 541 activated to Satellite 541 RHEL6 3.Create Custom Software Channel - test-rhn-package-manager 4.rhn_package_manager -c test-rhn-package-manager-test jabberpy-0.5-0.19.el6sat.noarch.rpm --username=admin --password=admin Actual results: While running 'packages.uploadPackageInfo': caught <type 'exceptions.ValueError'> : unknown header tag Expected results: Success. Additional info: For logs and more info please see attachment. Satellite Logs: ### /var/log/httpd/error_log ########################################## [Wed Jun 08 12:47:10 2011] [error] Extra information about this error: [Wed Jun 08 12:47:10 2011] [error] Response sent back to the caller: [Wed Jun 08 12:47:10 2011] [error] While running 'packages.uploadPackageInfo': caught [Wed Jun 08 12:47:10 2011] [error] <type 'exceptions.ValueError'> : unknown header tag [Wed Jun 08 12:47:10 2011] [error] [Wed Jun 08 12:47:10 2011] [error] [Wed Jun 08 12:47:10 2011] [error] [Wed Jun 08 12:47:10 2011] [error] Exception Handler Information [Wed Jun 08 12:47:10 2011] [error] Traceback (most recent call last): [Wed Jun 08 12:47:10 2011] [error] File "/usr/share/rhn/server/apacheRequest.py", line 120, in call_function [Wed Jun 08 12:47:10 2011] [error] response = apply(func, params) [Wed Jun 08 12:47:10 2011] [error] File "/usr/share/rhn/server/handlers/xp/packages.py", line 49, in uploadPackageInfo [Wed Jun 08 12:47:10 2011] [error] return uploadPackages(info, caller="server.xp.uploadPackageInfo") [Wed Jun 08 12:47:10 2011] [error] File "/usr/share/rhn/server/importlib/packageUpload.py", line 46, in uploadPackages [Wed Jun 08 12:47:10 2011] [error] p = __processPackage(package, org_id, channelList, source) [Wed Jun 08 12:47:10 2011] [error] File "/usr/share/rhn/server/importlib/packageUpload.py", line 92, in __processPackage [Wed Jun 08 12:47:10 2011] [error] if not header: [Wed Jun 08 12:47:10 2011] [error] File "/usr/lib/python2.6/site-packages/spacewalk/common/rhn_rpm.py", line 142, in __getattr__ [Wed Jun 08 12:47:10 2011] [error] return getattr(self.hdr, name) [Wed Jun 08 12:47:10 2011] [error] ValueError: unknown header tag [Wed Jun 08 12:47:10 2011] [error]
Even before the traceback shown above, there is also a traceback of: [Fri Jun 10 09:24:09 2011] [error] Extra information about this error: [Fri Jun 10 09:24:09 2011] [error] Response sent back to the caller: [Fri Jun 10 09:24:09 2011] [error] While running 'packages.no_op': caught [Fri Jun 10 09:24:09 2011] [error] <class 'server.apacheRequest.UnknownXML'> : Invalid request received (function: packages.no_op invalid). [Fri Jun 10 09:24:09 2011] [error] [Fri Jun 10 09:24:09 2011] [error] [Fri Jun 10 09:24:09 2011] [error] [Fri Jun 10 09:24:09 2011] [error] Exception Handler Information [Fri Jun 10 09:24:09 2011] [error] Traceback (most recent call last): [Fri Jun 10 09:24:09 2011] [error] File "/usr/share/rhn/server/apacheRequest.py", line 118, in call_function [Fri Jun 10 09:24:09 2011] [error] func = self.method_ref(method) [Fri Jun 10 09:24:09 2011] [error] File "/usr/share/rhn/server/apacheRequest.py", line 439, in method_ref [Fri Jun 10 09:24:09 2011] [error] raise UnknownXML("function: %s invalid" % (method,)) [Fri Jun 10 09:24:09 2011] [error] UnknownXML: Invalid request received (function: packages.no_op invalid).
In the code at/around header = rhn_rpm.headerLoad(package['header'].data) if not header: raise rhnFault(50) the header there is instance of rhn_rpm.RPM_Header (even if it will print itself as <rpm.hdr object at 0x7fb035c7c8f0>). And where things start to fail is when that object is use in that boolean (?) context in the if. When I change the code to header = rhn_rpm.headerLoad(package['header'].data) if header is None: raise rhnFault(50) the rhn_package_manager passes without error.
Another way to address the problem is to define __nonzero__ in rhn_rpm.RPM_Header, to evaluate to the boolean value of that hdr thing. This might actually be closer to the original semantics (I have no idea when that header object should return False).
Taking.
The change described in comment 3 is now in Spacewalk master, b351af640cd3683cff909b8dd440a5d74cf9d779.
Backported to SATELLITE-5.4 as commit 51e02970f1956dbcaf4c4bc2dcc125a99d43e5ae 711805 - explicitly define the boolean behaviour of the object.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1466.html