Unknown delivery tag when ack message

62 views
Skip to first unread message

Orges Skura

unread,
Dec 1, 2023, 6:57:51 AM12/1/23
to Pika
Hello. I keep having this error when ack message: pika.exceptions.ChannelClosedByBroker: (406, 'PRECONDITION_FAILED - unknown delivery tag 144'). The auto_ack is False and I am not sure why this error keeps popping up.

Terry Rinck

unread,
Dec 1, 2023, 10:19:54 AM12/1/23
to pika-...@googlegroups.com
Sounds like you may be sending the ack on a different channel than the one the message was delivered on.

On Fri, Dec 1, 2023 at 6:57 AM 'Orges Skura' via Pika <pika-...@googlegroups.com> wrote:
Hello. I keep having this error when ack message: pika.exceptions.ChannelClosedByBroker: (406, 'PRECONDITION_FAILED - unknown delivery tag 144'). The auto_ack is False and I am not sure why this error keeps popping up.

--
You received this message because you are subscribed to the Google Groups "Pika" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pika-python...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pika-python/51ad70e7-0af5-4019-a36a-39c1b523143fn%40googlegroups.com.

Orges Skura

unread,
Dec 1, 2023, 10:25:53 AM12/1/23
to Pika
Yeah I could be. I am also running message retrieval on a different thread to the processing thread and hence forced to use add_callback_threadsafe. Do you have any reccomendations on how to run this efficiently and ensure tags are sent through the same channel?

terren...@gmail.com

unread,
Dec 1, 2023, 12:11:22 PM12/1/23
to pika-...@googlegroups.com
If you couple your messages as they’re delivered to the delivering channel somehow it should be easy from there to ensure you’re only sending acks on that channel. Associate the channel with the messages, and if the channel is closed, drop the channel object/reference to invalidate the message and prevents ack attempts. For example, if there’s a disconnect event your channel will be closed, but your app could still have a live object you could acknowledge in, but an error will be raised. 

Does that make sense?

Sent from my iPhone

On Dec 1, 2023, at 10:25 AM, 'Orges Skura' via Pika <pika-...@googlegroups.com> wrote:

Yeah I could be. I am also running message retrieval on a different thread to the processing thread and hence forced to use add_callback_threadsafe. Do you have any reccomendations on how to run this efficiently and ensure tags are sent through the same channel?

Orges Skura

unread,
Dec 1, 2023, 1:03:04 PM12/1/23
to Pika
Yeah this makes sense to me. Thanks for your reply

errol

unread,
Jan 26, 2024, 4:10:48 AMJan 26
to Pika
As a side note, this also happens when you ACK the same tag twice.
Reply all
Reply to author
Forward
0 new messages