laravel-queue-rabbitmq icon indicating copy to clipboard operation
laravel-queue-rabbitmq copied to clipboard

Broken pipe or closed connection - PhpAmqpLib\Connection\AMQPLazySSLConnection::channel

Open shifas05 opened this issue 3 years ago • 2 comments

Hi,

Iam getting Broken pipe or closed connection error intermittently in server

vladimir-yuldashev/laravel-queue-rabbitmq: 11.3, php: 7.4

PhpAmqpLib\Exception\AMQPConnectionClosedException · Broken pipe or closed connection Full Trace Rawvendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php:171 PhpAmqpLib\Wire\IO\StreamIO::read

while ($read < $len) 
{            
    if (!is_resource($this->sock) || feof($this->sock)) {                
        $this->close();                
        throw new AMQPConnectionClosedException('Broken pipe or closed connection');             
    }            
    
    $this->setErrorHandler(); 

vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AMQPLazySSLConnection.php:14 PhpAmqpLib\Connection\AMQPLazySSLConnection::channel


    {
        $this->connect();
        return parent::channel($channel_id);
    }

Bug image - https://imgur.com/a/pNxBgSJ

Thank you.

shifas05 avatar Mar 30 '22 06:03 shifas05

did you fix this @shifas05 ? I'm facing same issue

nyssLab avatar Jul 28 '22 11:07 nyssLab

You managed to solve the problem? I have the same mistake. How did you solve the problem?

BinZhiZhu avatar Sep 08 '22 09:09 BinZhiZhu

I set RABBITMQ_VHOST value in env to '/' and problem solved. RABBITMQ_VHOST='/'

paranoia6 avatar Nov 18 '22 02:11 paranoia6

Hello Guys,

I have the same problem. Sometimes this error happens and then stops by itself. I run my queue with queue:work. Do you do that too, or do you run a command rabbitmq:consume?

tssantana avatar Dec 15 '22 20:12 tssantana

Connection errors are to be expected. When those happen, other laravel queue implementation will stop the worker and this library is following the same pattern. The best way around this is to restart your workers after such failure. Tools like supervisord are usually chosen for this.

khepin avatar Feb 04 '23 01:02 khepin