RabbitMQ 2.4 breaks txAMQP

Bug #741147 reported by Aitor Guevara
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
txAMQP
Fix Released
High
Thomas Herve

Bug Description

txAMQP has worked flawlessly for us with RabbitMQ 2.3.x, using amqp0-8.stripped.rabbitmq.xml.

We've just tried RabbitMQ 2.4 as it's been released, and we get the following traceback:

 Traceback (most recent call last):
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/twisted/python/log.py", line 84, in callWithLogger
     return callWithContext({"system": lp}, func, *args, **kw)
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/twisted/python/log.py", line 69, in callWithContext
     return context.call({ILogContext: newCtx}, func, *args, **kw)
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/twisted/python/context.py", line 59, in callWithContext
     return self.currentContext().callWithContext(ctx, func, *args, **kw)
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/twisted/python/context.py", line 37, in callWithContext
     return func(*args,**kw)
 --- <exception caught here> ---
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/twisted/internet/selectreactor.py", line 146, in _doReadOrWrite
     why = getattr(selectable, method)()
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/twisted/internet/tcp.py", line 460, in doRead
     return self.protocol.dataReceived(data)
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/txamqp/protocol.py", line 157, in dataReceived
     frame = self._unpackFrame(packet)
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/txamqp/protocol.py", line 133, in _unpackFrame
     payload = Frame.DECODERS[frameType].decode(self.spec, c)
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/txamqp/connection.py", line 93, in decode
     args = tuple([c.decode(f.type) for f in meth.fields])
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/txamqp/codec.py", line 86, in decode
     return getattr(self, "decode_" + type)()
   File "/home/foo/virtualenvs/bar/lib/python2.6/site-packages/txamqp/codec.py", line 191, in decode_table
     raise ValueError(repr(type))
 exceptions.ValueError: 'F'

Trying a differend spec (amqp0-9-1.stripped.xml) has not helped.

Revision history for this message
Esteve Fernandez (esteve) wrote :

Hi Aitor, thanks for using txAMQP.

Could you paste /var/log/rabbit.log too? Does it happen when calling authenticate on the AMQP client? Or does it happen during the application lifetime?

Thanks!

Changed in txamqp:
assignee: nobody → Esteve Fernandez (esteve)
Revision history for this message
Aitor Guevara (aitorciki) wrote :

Hi.

The error happens on connection, the application can't even start because of the connection failure. Here's a rabbit 2.4 log of the session (note that I'm nos stopping the application myself, it's crashing with the bug report's traceback):

=INFO REPORT==== 24-Mar-2011::12:21:52 ===
accepted TCP connection on [::]:5672 from 127.0.0.1:60299

=INFO REPORT==== 24-Mar-2011::12:21:52 ===
starting TCP connection <0.265.0> from 127.0.0.1:60299

=WARNING REPORT==== 24-Mar-2011::12:21:52 ===
exception on TCP connection <0.265.0> from 127.0.0.1:60299
connection_closed_abruptly

=INFO REPORT==== 24-Mar-2011::12:21:52 ===
closing TCP connection <0.265.0> from 127.0.0.1:60299

Revision history for this message
Thomas Herve (therve) wrote :

Here's a trivial patch to fix it:

=== modified file 'src/txamqp/codec.py'
--- src/txamqp/codec.py 2010-03-15 04:41:03 +0000
+++ src/txamqp/codec.py 2011-03-24 13:29:30 +0000
@@ -187,6 +187,8 @@
         value = self.decode_longstr()
       elif type == "I":
         value = self.decode_long()
+ elif type == "F":
+ value = self.decode_table()
       else:
         raise ValueError(repr(type))
       result[key] = value

Revision history for this message
Aitor Guevara (aitorciki) wrote :

Thomas' patch seems to work. I'll report if extended usage shows any other problem.

Revision history for this message
Michał Pasternak (dotz) wrote :

+1, patch works for me too.

Revision history for this message
Esteve Fernandez (esteve) wrote :

Thank you Thomas for the patch and thank you Aitor and Michał for testing it. I think the inability to connect to RabbitMQ 2.4 was caused by this [1]:

"- have the server present its AMQP extensions in a "capabilities" field in server-properties. See http://www.rabbitmq.com/extensions.html#capabilities for more information."

http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-March/011985.html

Apparently, the capabilities field is exposed as a table, and txAMQP didn't support them. I just committed the fix.

Changed in txamqp:
assignee: Esteve Fernandez (esteve) → Thomas Herve (therve)
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
Philip K. Warren (pkwarren) wrote :

I am still seeing an issue connecting to RabbitMQ 2.4 with txAMQP. The new error is due to failing to parse a boolean value in the table (there are four boolean values - publisher_confirms, exchange_exchange_bindings, basic.nack, and consumer_cancel_notify). I have attached a patch which seems to fix the issue.

Revision history for this message
Michał Pasternak (dotz) wrote : Re: [Bug 741147] Re: RabbitMQ 2.4 breaks txAMQP

Cool. Do we need more datatypes?
07-04-2011 23:41 użytkownik "Pkwarren" <email address hidden> napisał:

Revision history for this message
Philip K. Warren (pkwarren) wrote :

I'm not sure if a new datatype is required. The patch should probably have been:

value = (self.decode_octet() != 0)

instead of:

value = (self.decode_octet() > 0)

Revision history for this message
Thomas Herve (therve) wrote :

I think this is an issue with 0-9-1 support. Authentication doesn't work for me either using it. Please open another bug.

Revision history for this message
Maarten Damen (m-damen) wrote :

Having the same issue as Thomas is having, authentication does not work for both the 0.9.0 and 0.9.1 specs. Any hints?

Revision history for this message
Terry Jones (terrycojones) wrote :

Hi Maarten

Does the suggestionf from @Pkwarren help?

Changed in txamqp:
status: Fix Committed → Fix Released
Revision history for this message
Bob Claerhout (claerhout-bob) wrote :

I don't have a clue how fast those things go, but I installed txamqp today and the issue was still there.

Revision history for this message
Esteve Fernandez (esteve) wrote :

Bob, which of the reported issues don't work for you? I just ran the testsuite with the latest version of RabbitMQ (3.1.5) and all the tests pass.

Revision history for this message
Bob Claerhout (claerhout-bob) wrote :

I'm getting this error: "exceptions.ValueError: 'F'"

Revision history for this message
Esteve Fernandez (esteve) wrote :

Bob, could you paste a traceback of your program crashing? Tables are definitely (F type) handled in both the latest released version (0.6.2) and in the trunk branch of txamqp:

http://bazaar.launchpad.net/~txamqpteam/txamqp/trunk/view/head:/src/txamqp/codec.py#L190

Thanks!

Revision history for this message
Bob Claerhout (claerhout-bob) wrote :

I'm getting the exact same error as the one that was given by the start of this thread. I installed it with "yum install python-txamqp". I fixed it with the patch that was given by Thomas Herve.
Kind regards

Revision history for this message
Esteve Fernandez (esteve) wrote :

It seems Fedora/CentOS/RHEL ships with an outdated version of txAMQP.
What's the output of yum info python-txamqp? In any case, it's
recommended to use PIP to install the latest version of txAMQP (pip
install txamqp), as you may be missing features or bugfixes not
present in previous versions.

2013/10/6 Bob Claerhout <email address hidden>:
> I'm getting the exact same error as the one that was given by the start of this thread. I installed it with "yum install python-txamqp". I fixed it with the patch that was given by Thomas Herve.
> Kind regards
>
> --
> You received this bug notification because you are a member of txAMQP
> Team, which is subscribed to txAMQP.
> https://bugs.launchpad.net/bugs/741147
>
> Title:
> RabbitMQ 2.4 breaks txAMQP
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/txamqp/+bug/741147/+subscriptions

Revision history for this message
Bob Claerhout (claerhout-bob) wrote :

OK, thanks for fast responses. Hopefully these distros get the latest version of txAMQP quickly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.