[rabbitmq-discuss] rabbitmq-c + 1.6.0 = bad headers

126 views
Skip to first unread message

David Hawthorne

unread,
Apr 27, 2011, 8:00:10 PM4/27/11
to rabbitmq...@lists.rabbitmq.com
I saw this, which indicates that rabbitmq-c should Just Work:


Note that I'm using the rabbitmq-cpp wrapper around it (I think it's called amqpcpp officially).

client sees:

Expected 0x000A000A method frame on channel 0, got frame type 65

servers log shows:

=INFO REPORT==== 27-Apr-2011::23:55:28 ===
accepted TCP connection on 0.0.0.0:5672 from 127.0.0.1:51239

=INFO REPORT==== 27-Apr-2011::23:55:28 ===
starting TCP connection <0.19296.210> from 127.0.0.1:51239

=ERROR REPORT==== 27-Apr-2011::23:55:28 ===
exception on TCP connection <0.19296.210> from 127.0.0.1:51239
{bad_header,<<65,77,81,80,0,0,9,1>>}

=INFO REPORT==== 27-Apr-2011::23:55:28 ===
closing TCP connection <0.19296.210> from 127.0.0.1:51239

Any help you can give on this would be greatly appreciated.  I'm testing against 1.6.0 because that's what apt-get gave me, but I'm not averse to upgrading.

Thanks!

Alexis Richardson

unread,
Apr 28, 2011, 5:43:32 AM4/28/11
to David Hawthorne, rabbitmq...@lists.rabbitmq.com
David

I am cc'ing akalend who wrote amqpcpp.

alexis

> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq...@lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

David Wragg

unread,
Apr 28, 2011, 8:55:19 AM4/28/11
to David Hawthorne, rabbitmq...@lists.rabbitmq.com
David Hawthorne <dha...@3crowd.com> writes:
> I saw this, which indicates that rabbitmq-c should Just Work:
>
> http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2009-June/003858.html

That email is quite old.

> Note that I'm using the rabbitmq-cpp wrapper around it (I think it's called amqpcpp officially).
>
> client sees:
>
> Expected 0x000A000A method frame on channel 0, got frame type 65

> [...]


>
> Any help you can give on this would be greatly appreciated. I'm
> testing against 1.6.0 because that's what apt-get gave me, but I'm not
> averse to upgrading.

You are using a version of the rabbitmq-c client that only talks
AMQP-0.9.1 with a version of rabbitmq-server that only talks AMQP-0.8.
The easiest route forward is to upgrade your servert to 2.0 or later.

--
David Wragg
Staff Engineer, RabbitMQ
VMware, Inc.

Pieter de Zwart

unread,
Apr 28, 2011, 12:38:28 PM4/28/11
to David Wragg, David Hawthorne, rabbitmq...@lists.rabbitmq.com
Upgrade to 2.*. Trust me. You do not want to deal with the 0-8/0-9-1
compatibility dance =)

Pieter


On 4/28/11 5:55 AM, "David Wragg" <da...@rabbitmq.com> wrote:

> David Hawthorne <dha...@3crowd.com> writes:
>> I saw this, which indicates that rabbitmq-c should Just Work:
>>
>> http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2009-June/003858.html
>
> That email is quite old.
>
>> Note that I'm using the rabbitmq-cpp wrapper around it (I think it's called
>> amqpcpp officially).
>>
>> client sees:
>>
>> Expected 0x000A000A method frame on channel 0, got frame type 65
>> [...]
>>
>> Any help you can give on this would be greatly appreciated. I'm
>> testing against 1.6.0 because that's what apt-get gave me, but I'm not
>> averse to upgrading.
>
> You are using a version of the rabbitmq-c client that only talks
> AMQP-0.9.1 with a version of rabbitmq-server that only talks AMQP-0.8.
> The easiest route forward is to upgrade your servert to 2.0 or later.

_______________________________________________

David Hawthorne

unread,
Apr 28, 2011, 3:51:35 PM4/28/11
to Pieter de Zwart, rabbitmq...@lists.rabbitmq.com
Ah, good to know. FWIW, it's not easy to find out what versions of the AMQP spec the various versions of rabbitmq support when digging through the website. Likewise, the README for rabbitmq-c doesn't have a list of server versions it should work with. Either one of those would have cleared this up. Not a criticism, just an observation.

Anyone know why the apt-installed package hasn't been updated since 1.6.0?

Thanks for the help!

David Hawthorne

unread,
Apr 28, 2011, 5:48:15 PM4/28/11
to Pieter de Zwart, Alexandre Kalendarev, rabbitmq...@lists.rabbitmq.com
Here's another problem, this time using amqpcpp with 2.4.1:

dhawth@u16$ ./example_get
server connection error 504, message: CHANNEL_ERROR - unexpected method in connection state running

dhawth@u16$ ./example_consume
server connection error 504, message: CHANNEL_ERROR - unexpected method in connection state running

Server logs don't show anything other than connection open and close.

This happens after the createQueue, and then queue->Declare lines.


On Apr 28, 2011, at 9:38 AM, Pieter de Zwart wrote:

David Hawthorne

unread,
Apr 28, 2011, 8:47:13 PM4/28/11
to David Wragg, Alexandre Kalendarev, Pieter de Zwart, rabbitmq...@lists.rabbitmq.com
I'm continuing to dig down into this, and have discovered the following:

1. amqpcpp doesn't work with versions 2.0, 2.2, or 2.4.1
2. the server is sending a AMQP_RESPONSE_SERVER_EXCEPTION back during the amqp_channel_open call in rabbitmq-c
3. the rabbitmq-c tools in the tools/ subdirectory all work fine
4. rabbitmq the server doesn't give any logging outside of starting and closing the TCP connection, and I can't find a way to enable more verbose logging

I'll keep digging to see if I can find more useful information.

from amqp.h:

typedef enum amqp_response_type_enum_ {
AMQP_RESPONSE_NONE = 0,
AMQP_RESPONSE_NORMAL,
AMQP_RESPONSE_LIBRARY_EXCEPTION,
AMQP_RESPONSE_SERVER_EXCEPTION
} amqp_response_type_enum;

from my test program:

0 [0x7f1033a7f750] DEBUG AMQP null - Making new connection to amqp server
2 [0x7f1033a7f750] DEBUG AMQP null - Logging into amqp server
5 [0x7f1033a7f750] DEBUG main null - creating queue foobar
5 [0x7f1033a7f750] DEBUG AMQP null - creating queue with name foobar
5 [0x7f1033a7f750] DEBUG AMQPQueue null - constructing new queue with channelNum 0 and name foobar
5 [0x7f1033a7f750] DEBUG AMQPQueue null - opening channel
amqp_simple_rpc_decoded reply type is 3 in amqp_simple_rpc_decoded in amqp_socket.c
5 [0x7f1033a7f750] DEBUG AMQPQueue null - amqp_channel_open returned null

David Wragg

unread,
Apr 28, 2011, 9:53:09 PM4/28/11
to David Hawthorne, rabbitmq...@lists.rabbitmq.com
Hi David,

David Hawthorne <dsrt...@gmail.com> writes:
> On Apr 28, 2011, at 2:48 PM, David Hawthorne wrote:
>
>> Here's another problem, this time using amqpcpp with 2.4.1:
>>
>> dhawth@u16$ ./example_get
>> server connection error 504, message: CHANNEL_ERROR - unexpected method in connection state running
>>
>> dhawth@u16$ ./example_consume
>> server connection error 504, message: CHANNEL_ERROR - unexpected method in connection state running

This error suggests that you are trying to use channel number 0 (which
has a special role in AMQP) for general methods.

> [...]


> from my test program:
>
> 0 [0x7f1033a7f750] DEBUG AMQP null - Making new connection to amqp server
> 2 [0x7f1033a7f750] DEBUG AMQP null - Logging into amqp server
> 5 [0x7f1033a7f750] DEBUG main null - creating queue foobar
> 5 [0x7f1033a7f750] DEBUG AMQP null - creating queue with name foobar
> 5 [0x7f1033a7f750] DEBUG AMQPQueue null - constructing new queue with
> channelNum 0 and name foobar

And this line suggests the same thing.

But looking at the amqpcpp code on github, I don't see how that could
happen. AMQP::init sets channelNumber to 0, and AMQP::createQueue
increments it. Are you using amqpcpp from github without modification
(other than adding the logging)?

Alexandre: By the way, the channelNumber allocation logic in amqpcpp
looks wrong to me. But it shouldn't affect the examples where only a
single channel is used, so I don't think that's the cause of David's
problem.

David

--
David Wragg
Staff Engineer, RabbitMQ
VMware, Inc.

Jim Apperly

unread,
May 5, 2011, 9:36:45 AM5/5/11
to David Hawthorne, rabbitmq...@lists.rabbitmq.com
On 28 April 2011 20:51, David Hawthorne <dha...@3crowd.com> wrote:
FWIW, it's not easy to find out what versions of the AMQP spec the various versions of rabbitmq support when digging through the website.

It could be clearer, I know, but you can infer some of that from http://www.rabbitmq.com/changelog.html.

Jim


Matthias Radestock

unread,
May 8, 2011, 11:30:19 AM5/8/11
to David Hawthorne, rabbitmq...@lists.rabbitmq.com, Jim Apperly
Jim Apperly wrote:
> On 28 April 2011 20:51, David Hawthorne <dha...@3crowd.com
> <mailto:dha...@3crowd.com>> wrote:
> FWIW, it's not easy to find out what versions of the AMQP spec the
> various versions of rabbitmq support when digging through the
> website.
>
> It could be clearer, I know, but you can infer some of that from
> http://www.rabbitmq.com/changelog.html.

Or take a look at

http://www.rabbitmq.com/specification.html#release-version-mapping

:)

Matthias.

Reply all
Reply to author
Forward
0 new messages