Bug 489037

Summary: Python type mapping interop issue with Java and C++
Product: Red Hat Enterprise MRG Reporter: Matthew Farrellee <matt>
Component: python-qpidAssignee: Rafael H. Schloming <rafaels>
Status: CLOSED ERRATA QA Contact: Frantisek Reznicek <freznice>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 1.1CC: esammons, gsim, tross
Target Milestone: 1.1.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-21 16:17:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Farrellee 2009-03-06 21:14:43 UTC
Description of problem:

The python-qpid client library is not interoperable with Java or C++


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

python-qpid-0.4.750054-1.el5


Actual results:

 Traceback (most recent call last):
   File "/usr/lib64/python2.4/threading.py", line 442, in __bootstrap
     self.run()
   File "/usr/lib64/python2.4/threading.py", line 422, in run
     self.__target(*self.__args, **self.__kwargs)
   File "/usr/sbin/carod", line 321, in handle_get_work
     send_AMQP_msg(broker_connection, msg, msg_props, err_msg)
   File "/usr/sbin/carod", line 264, in send_AMQP_msg
     connection.message_transfer(destination=reply_to['exchange'], message=Message(msg_properties, delivery_props, data))
   File "/usr/lib/python2.4/site-packages/qpid/generator.py", line 25, in <lambda>
     method = lambda self, *args, **kwargs: self.invoke(inst, args, kwargs)
   File "/usr/lib/python2.4/site-packages/qpid/session.py", line 143, in invoke
     return self.do_invoke(type, args, kwargs)
   File "/usr/lib/python2.4/site-packages/qpid/session.py", line 186, in do_invoke
     sc.write_struct32(st)
   File "/usr/lib/python2.4/site-packages/qpid/codec010.py", line 244, in write_struct32
     value._type.encode_fields(sc, value)
   File "/usr/lib/python2.4/site-packages/qpid/spec010.py", line 256, in encode_fields
     f.type.encode(codec, values[f.name])
   File "/usr/lib/python2.4/site-packages/qpid/spec010.py", line 147, in encode
     getattr(codec, "write_%s" % self.name)(value)
   File "/usr/lib/python2.4/site-packages/qpid/codec010.py", line 174, in write_map
     type.encode(sc, v)
   File "/usr/lib/python2.4/site-packages/qpid/spec010.py", line 147, in encode
     getattr(codec, "write_%s" % self.name)(value)
   File "/usr/lib/python2.4/site-packages/qpid/codec010.py", line 139, in write_vbin16
     self.write(b)
   File "/usr/lib/python2.4/site-packages/qpid/codec010.py", line 296, in write
     self.encoded += s
 UnicodeDecodeError: 'ascii' codec can't decode byte 0x90 in position 15: ordinal not in range(128)

Additional info:

This is potentially addressed in python-qpid-0.4.750960-1.el5. However, part of the fix exposes an issue in the qmf python client and it's method of parsing UUIDs...

    return "%08x-%04x-%04x-%04x-%04x%08x" % struct.unpack("!LHHHHL", self.bytes)
TypeError: unpack() argument 2 must be string or read-only buffer, not instance

Comment 1 Gordon Sim 2009-03-09 16:19:46 UTC
Rafi, is this fixed? Can you add the relevant revision and est procedure if so. Thanks.

Comment 2 Rafael H. Schloming 2009-03-09 19:11:12 UTC
This is fixed including the qmf issue as of 751092. The devel rpms have been updated to that revision. I'm marking as modified.

Comment 4 Frantisek Reznicek 2009-03-16 11:19:43 UTC
No test info included. 
Just seen call connection.message_transfer(...) in "/usr/sbin/carod".

Could you possibly shortly describe how to reproduce, please?

Comment 5 Ted Ross 2009-03-17 16:04:32 UTC
Test case:

Run qpid-tool (where PYTHONPATH references the python libraries under test) against a running broker.

$ qpid-tool
Management Tool for QPID
qpid:

Type "show system".  If it returns with "Class not known: system", wait a few seconds and retry.

If the bug is fixed, the output will look something like the following (actual values will differ, all that matters is that the properties are displayed):

qpid: show system
Object of type org.apache.qpid.broker:system: (last sample time: 15:49:32)
    Type      Element   101
    ==========================================================
    property  systemId  cb5a250e-fe5c-440c-95dd-9e792876be20
    property  osName    Linux
    property  nodeName  localhost.localdomain
    property  release   2.6.27.19-170.2.35.fc10.i686
    property  version   #1 SMP Mon Feb 23 13:21:22 EST 2009
    property  machine   i686

The failure case results in no output:

qpid: show system
qpid:

Comment 6 Frantisek Reznicek 2009-03-18 13:57:38 UTC
Testing in progress, no issue found on RHEL 4.7 / 5.2 / 5.3 i386 / x86_64.
Trying F10 for reproducing the issue (seems to be fedora related only).

Comment 7 Frantisek Reznicek 2009-03-19 10:09:54 UTC
The initial issue and also UUID symptom from comment 5 were fixed, validated on RHEL 4.7 / 5.2 / 5.3 , i386 / x86_64 on packages:
python-qpid-0.5.752581-1.el5, qpidd-0.5.752581-1.el5, qpidc-0.5.752581-1.el5

->VERIFIED

Comment 9 errata-xmlrpc 2009-04-21 16:17:06 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0434.html