Pika 1.2.0 - Error 505

237 views
Skip to first unread message

Arun VJ

unread,
Jun 15, 2023, 1:28:11 AM6/15/23
to rabbitmq-users
Hi,

I'm seeing an intermittent issue with Pika 1.2.0

Error -> (505) UNEXPECTED_FRAME - expected content header for class 60, got non content header frame instead

I'm not able to find solution for this, Can anyone help please ?

Thanks,
Arun

Luke Bakken

unread,
Jun 15, 2023, 9:50:10 AM6/15/23
to rabbitmq-users
Hello,

We need a lot more information from you, since that is a very strange issue.
  • Erlang, RabbitMQ and Python versions
  • What does RabbitMQ log at the same time as the issue?
  • Does the issue happen when publishing, consuming or both?
  • Does it happen at the beginning of a new connection or on an established connection?
  • Is there a proxy or any other network device between your application and RabbitMQ?
  • Can you provide your code?
Thanks,
Luke

Arun VJ

unread,
Jun 16, 2023, 1:51:31 AM6/16/23
to rabbitmq-users
Thanks Luke for the reply.

Details below - 

1. Python - 3.8.10   RabbitMQ - 3.9.20  Erlang - 24.3.4.2

2. [error] <0.28638.0> Error on AMQP connection <0.28638.0> (10.20.0.15:55856 -> 10.20.0.12:5672, vhost: '/', user: 'guest', state: running), channel 1:
    [error] <0.28638.0>  operation basic.publish caused a connection exception unexpected_frame: "expected content body, got non content body frame instead"
    [info] <0.28638.0> closing AMQP connection <0.28638.0> (10.20.0.15:55856 -> 10.20.0.12:5672, vhost: '/', user: 'guest')
    [info] <0.28675.0> accepting AMQP connection <0.28675.0> (10.20.0.15:36752 -> 10.20.0.12:5672

3. Based on the RabbitMQ Logs, It seems like only during Publish.

4. Not at the beginning - Its just intermittent as well later in terms of when it appears, but It will always appear.

5. There is no device/proxy between app and RabbitMQ

6. One thing about the code is, Its using same channel for publish and consume, I also tried to separate it, still I see the issue.

Thanks,
Arun
Message has been deleted

Luke Bakken

unread,
Jun 16, 2023, 1:06:37 PM6/16/23
to rabbitmq-users
Hello,

The version of RabbitMQ you are using goes out of support in a month. Just FYI.

2. [error] <0.28638.0> Error on AMQP connection <0.28638.0> (10.20.0.15:55856 -> 10.20.0.12:5672, vhost: '/', user: 'guest', state: running), channel 1:
    [error] <0.28638.0>  operation basic.publish caused a connection exception unexpected_frame: "expected content body, got non content body frame instead"
    [info] <0.28638.0> closing AMQP connection <0.28638.0> (10.20.0.15:55856 -> 10.20.0.12:5672, vhost: '/', user: 'guest')
    [info] <0.28675.0> accepting AMQP connection <0.28675.0> (10.20.0.15:36752 -> 10.20.0.12:5672

My guess is that your application is multi-threaded, and your Pika connection or channel used for publishing is shared across threads.

The code you provided does not show publishing, but it does show multiple threads being used.

Thanks,
Luke

Arun VJ

unread,
Jun 16, 2023, 1:29:57 PM6/16/23
to rabbitmq-users
Hi Luke, Yes I'm using multi threads to process the messages from queue, If I remove that, I don't see the 505 error but It becomes very slow as its now just one thread that needs to process thousand's of messages.
In between I now see this error -  Channel 1 was closed: (Stream connection lost: ConnectionResetError(104, 'Connection reset by peer'))

So do you think the way I've used threads is not recommended to process queue ? 

Gavin M. Roy

unread,
Jun 16, 2023, 1:37:05 PM6/16/23
to rabbitm...@googlegroups.com
Pika is not thread safe. See https://pika.readthedocs.io/en/stable/faq.html - you're most likely publishing in the middle of receiving a message.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/040153c7-8a74-4f68-aafa-03591fb75a66n%40googlegroups.com.

Luke Bakken

unread,
Jun 16, 2023, 1:37:53 PM6/16/23
to rabbitmq-users
Pika's documentation clearly states that Pika is not thread safe at all.

There is an example of processing messages on threads - https://github.com/pika/pika/blob/main/examples/basic_consumer_threaded.py

If you need assistance with threading, you must share code that I can clone and run. A GitHub repository is a good way to do so.

As for the other error, what does RabbitMQ log at the same time?
Reply all
Reply to author
Forward
0 new messages