(406, 'PRECONDITION_FAILED - unknown delivery tag 2') error

2,457 views
Skip to first unread message

Akshaya

unread,
Jul 23, 2018, 7:44:19 AM7/23/18
to rabbitmq-users
Hi,

I am running the rabbitMQ message parsing as a python service. It is frequently failing with below error. Have not set no_ack=True anywhere.
How to fix this?

pika.exceptions.ChannelClosed: (406, 'PRECONDITION_FAILED - unknown delivery tag 2')

-Akshaya

Michael Klishin

unread,
Jul 23, 2018, 6:25:11 PM7/23/18
to rabbitm...@googlegroups.com
The doc guide that you are looking for is [1]. Please read the entire
part about consumer acknowledgements but specifically [2].


--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Akshaya

unread,
Jul 26, 2018, 10:25:33 AM7/26/18
to rabbitmq-users
Thank you for the reply. Have read the documents. Shall analyze further about this.
Have also used to reschedule the unacknowledged messages.

ch.basic_recover(requeue=True)

This may be a reason for this?

-Akshaya

On Tuesday, July 24, 2018 at 3:55:11 AM UTC+5:30, Michael Klishin wrote:
The doc guide that you are looking for is [1]. Please read the entire
part about consumer acknowledgements but specifically [2].

On Mon, Jul 23, 2018 at 2:44 PM, Akshaya <nach...@gmail.com> wrote:
Hi,

I am running the rabbitMQ message parsing as a python service. It is frequently failing with below error. Have not set no_ack=True anywhere.
How to fix this?

pika.exceptions.ChannelClosed: (406, 'PRECONDITION_FAILED - unknown delivery tag 2')

-Akshaya

--
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 post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Jul 26, 2018, 11:01:07 AM7/26/18
to rabbitm...@googlegroups.com
It could be. Explicit recovery of consumers has been a deprecated feature for years
(note how our docs never mention it except for the protocol document).

It would be easier for you (and members of this list alike) to reason about what's going on
from a traffic capture [1].


To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Akshaya

unread,
Jul 26, 2018, 11:11:40 AM7/26/18
to rabbitmq-users
Thank you. Shall try to implement wireshark.
BTW, what is the alternate way to recover the unacknowledged messages?

The below is my actual requirement related to unack messages:



- Akshaya

Akshaya

unread,
Jul 26, 2018, 11:15:18 AM7/26/18
to rabbitmq-users

Thank you. Shall try to implement wireshark.
BTW, what is the alternate way to recover the unacknowledged messages?

The below is my actual requirement related to unack messages:
        1. consume the messages in parallel from a queue.
        2. If the particular path in the message is already in use, then wait for sometime
        3. This waiting messages will be in unacknowledged state. So requeue it again and consume the same after some time.

This can be achieved by any other way?

Michael Klishin

unread,
Jul 26, 2018, 11:24:09 AM7/26/18
to rabbitm...@googlegroups.com
I don't understand the 3rd item, sorry.

[1] should cover everything you need to know. You can explicitly requeue N messages with the basic.nack method (a protocl
extension) or close and open a new channel (this is too extreme for most cases). basic.recover is not necessary to requeue
per se (it was introduced many years ago to let consumers indicate that they are no longer overloaded and the broker can continue
delivering messages, optionally with requeueing the currently unacknowledged ones).


To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Akshaya

unread,
Jul 26, 2018, 11:54:34 AM7/26/18
to rabbitmq-users
Thanks a lot. One final query.

I could not find the proper example anywhere for the basic nack using python.
Any boolean value needed in ch.basic_nack() or just this would be enough to requeue the message?

-Akshaya

Michael Klishin

unread,
Jul 26, 2018, 12:33:07 PM7/26/18
to rabbitm...@googlegroups.com
See Pika documentation for that function. There are two boolean parameters it accepts.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages