Php-amqplib: PRECONDITION_FAILED

Created on 19 Feb 2014  路  5Comments  路  Source: php-amqplib/php-amqplib

PHP Fatal error:  Uncaught exception 
'PhpAmqpLib\Exception\AMQPProtocolChannelException' with message 'PRECONDITION_FAILED - unknown delivery tag 1' in /var/www/backend/releases/20140218194308/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Channel/AMQPChannel.php:166#012Stack trace:#012#0 [internal function]: PhpAmqpLib\Channel\AMQPChannel->channel_close(Object(PhpAmqpLib\Wire\AMQPReader))#012#1 /var/www/backend/releases/20140218194308/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(105): call_user_func(Array, Object(PhpAmqpLib\Wire\AMQPReader))#012#2 /var/www/backend/releases/20140218194308/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(261): PhpAmqpLib\Channel\AbstractChannel->dispatch('20,40', '??,PRECONDITION...', NULL)#012#3 /var/www/backend/releases/20140218194308/tasks/async-picture-import.php(40): PhpAmqpLib\Channel\AbstractChannel->wait()#012#4 {main}#012  thrown in /var/www/backend/releases/20140218194308/vendor/videlalvaro/php-amqplib/PhpAmqpLib/Channel/AMQPChannel.php on line 166

anyone has tip why this is happen? i'm trying to connect with a php script to the mq but fails with this error

Most helpful comment

just ran across this, know this issue is old, but in case anybody else runs across it - check to be sure 4th param of basic_consume() is set to false (true means no ack). I had it set as true for some reason and got the exception thrown that the OP notes. Trying to ack a valid channel set to no ack/true will toss the exception

All 5 comments

@FrancisVarga you are trying to ack a delivery tag that doesn't exist on a channel, e.g. use automatic acknowledgements and try to manually ack deliveries, or try to ack on a different channel.

It's a good idea to use rabbitmq-discuss for questions.

just ran across this, know this issue is old, but in case anybody else runs across it - check to be sure 4th param of basic_consume() is set to false (true means no ack). I had it set as true for some reason and got the exception thrown that the OP notes. Trying to ack a valid channel set to no ack/true will toss the exception

@miked187 yes. To ack messages first you need to tell RabbitMQ that you are going to ack them when issuing a basic_consume, otherwise it's expected that an exception will happen.

@FrancisVarga you are trying to ack a delivery tag that doesn't exist on a channel, e.g. use automatic acknowledgements and try to manually ack deliveries, or try to ack on a different channel.

@michaelklishin then how to write for this can you help me from this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Majkl578 picture Majkl578  路  8Comments

AndreKlang picture AndreKlang  路  7Comments

kozlice picture kozlice  路  4Comments

tugrul picture tugrul  路  3Comments

nubeiro picture nubeiro  路  6Comments