Bug 711805 - rhn-package-manager fails to upload metadata to Satellite 541 RHEL6
Summary: rhn-package-manager fails to upload metadata to Satellite 541 RHEL6
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite Proxy 5
Classification: Red Hat
Component: Server
Version: 541
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Jan Pazdziora (Red Hat)
QA Contact: Dimitar Yordanov
URL:
Whiteboard:
Depends On:
Blocks: sat54-blockers
TreeView+ depends on / blocked
 
Reported: 2011-06-08 14:38 UTC by Dimitar Yordanov
Modified: 2011-12-07 07:44 UTC (History)
4 users (show)

Fixed In Version: spacewalk-backend-1.2.13-56
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-21 09:44:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
RHN-Package-Manager issue - Logs (9.09 KB, text/plain)
2011-06-08 14:38 UTC, Dimitar Yordanov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1466 0 normal SHIPPED_LIVE Red Hat Network Satellite server spacewalk-backend bug fix update 2011-11-21 14:43:48 UTC

Description Dimitar Yordanov 2011-06-08 14:38:09 UTC
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]

Comment 1 Jan Pazdziora (Red Hat) 2011-06-10 13:25:11 UTC
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).

Comment 2 Jan Pazdziora (Red Hat) 2011-06-13 10:14:43 UTC
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.

Comment 3 Jan Pazdziora (Red Hat) 2011-06-13 10:24:52 UTC
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).

Comment 4 Jan Pazdziora (Red Hat) 2011-06-13 10:27:30 UTC
Taking.

Comment 5 Jan Pazdziora (Red Hat) 2011-06-13 10:27:52 UTC
The change described in comment 3 is now in Spacewalk master, b351af640cd3683cff909b8dd440a5d74cf9d779.

Comment 6 Jan Pazdziora (Red Hat) 2011-06-13 10:28:04 UTC
The change described in comment 3 is now in Spacewalk master, b351af640cd3683cff909b8dd440a5d74cf9d779.

Comment 7 Michael Mráka 2011-10-26 08:58:25 UTC
Backported to SATELLITE-5.4 as
commit 51e02970f1956dbcaf4c4bc2dcc125a99d43e5ae
    711805 - explicitly define the boolean behaviour of the object.

Comment 10 errata-xmlrpc 2011-11-21 09:44:57 UTC
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


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